Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
J
jinfa-platform
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
XieZhiXiong
jinfa-platform
Commits
9c278f8d
Commit
9c278f8d
authored
Feb 16, 2022
by
XieZhiXiong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 添加 placeholder 属性
parent
2e3fd9b0
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
1 deletion
+13
-1
AreaSelectItem.tsx
...ts/AddressSelect/components/AreaSelect/AreaSelectItem.tsx
+6
-1
index.tsx
src/components/AddressSelect/components/AreaSelect/index.tsx
+7
-0
No files found.
src/components/AddressSelect/components/AreaSelect/AreaSelectItem.tsx
View file @
9c278f8d
...
...
@@ -38,10 +38,14 @@ interface AreaSelectItemProps {
* 自定义外部 className
*/
customClassName
?:
string
,
/**
* placeholder
*/
placeholder
?:
string
,
}
const
AreaSelectItem
:
React
.
FC
<
AreaSelectItemProps
>
=
(
props
)
=>
{
const
{
pcode
,
value
,
onChange
,
customClassName
}
=
props
;
const
{
pcode
,
value
,
onChange
,
customClassName
,
placeholder
}
=
props
;
const
[
innerValue
,
setInnerValue
]
=
useState
<
string
|
undefined
>
(
undefined
);
const
[
options
,
setOptions
]
=
useState
<
OptionType
[]
>
([]);
...
...
@@ -97,6 +101,7 @@ const AreaSelectItem: React.FC<AreaSelectItemProps> = (props) => {
value=
{
innerValue
}
onChange=
{
handleSelectChange
}
loading=
{
loading
}
placeholder=
{
placeholder
}
allowClear
/>
);
...
...
src/components/AddressSelect/components/AreaSelect/index.tsx
View file @
9c278f8d
...
...
@@ -3,6 +3,7 @@
*/
import
React
,
{
useState
,
useEffect
}
from
'react'
;
import
{
Row
,
Col
}
from
'antd'
;
import
{
useIntl
}
from
'umi'
;
import
themeConfig
from
'@/../config/lingxi.theme.config'
;
import
AreaSelectItem
,
{
AreaSelectValueType
}
from
'./AreaSelectItem'
;
import
styles
from
'./index.less'
;
...
...
@@ -27,6 +28,8 @@ const AreaSelect: React.FC<AreaSelectProps> = (props) => {
}
=
props
;
const
[
innerValues
,
setInnerValues
]
=
useState
<
AreaSelectValueType
[]
>
([]);
const
intl
=
useIntl
();
useEffect
(()
=>
{
if
(
'value'
in
props
&&
value
.
length
)
{
setInnerValues
(
value
);
...
...
@@ -74,6 +77,7 @@ const AreaSelect: React.FC<AreaSelectProps> = (props) => {
customClassName=
{
styles
[
'area-select-item'
]
}
value=
{
innerValues
[
0
]
}
onChange=
{
(
value
)
=>
handleSelectChange
(
value
,
0
)
}
placeholder=
{
intl
.
formatMessage
({
id
:
'components.shengfenzhixiashi'
},
{
default
:
'-省份/直辖市-'
})
}
/>
</
Col
>
<
Col
span=
{
6
}
>
...
...
@@ -82,6 +86,7 @@ const AreaSelect: React.FC<AreaSelectProps> = (props) => {
customClassName=
{
styles
[
'area-select-item'
]
}
value=
{
innerValues
[
1
]
}
onChange=
{
(
value
)
=>
handleSelectChange
(
value
,
1
)
}
placeholder=
{
intl
.
formatMessage
({
id
:
'components.shi'
},
{
default
:
'-市-'
})
}
/>
</
Col
>
<
Col
span=
{
6
}
>
...
...
@@ -90,6 +95,7 @@ const AreaSelect: React.FC<AreaSelectProps> = (props) => {
customClassName=
{
styles
[
'area-select-item'
]
}
value=
{
innerValues
[
2
]
}
onChange=
{
(
value
)
=>
handleSelectChange
(
value
,
2
)
}
placeholder=
{
intl
.
formatMessage
({
id
:
'components.qu'
},
{
default
:
'-区-'
})
}
/>
</
Col
>
<
Col
span=
{
6
}
>
...
...
@@ -98,6 +104,7 @@ const AreaSelect: React.FC<AreaSelectProps> = (props) => {
customClassName=
{
styles
[
'area-select-item'
]
}
value=
{
innerValues
[
3
]
}
onChange=
{
(
value
)
=>
handleSelectChange
(
value
,
3
)
}
placeholder=
{
intl
.
formatMessage
({
id
:
'components.jiedao'
},
{
default
:
'-街道-'
})
}
/>
</
Col
>
</
Row
>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment