Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
npm
/
glsx-components
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 31a64223
authored
Jun 15, 2022
by
luyt
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
fix:解决省市选择重复的key问题-有些省市的code是一样的
1 parent
45f754c6
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
7 deletions
src/packages/GLProvince/src/index.vue
src/packages/GLProvince/src/index.vue
View file @
31a6422
...
...
@@ -2,13 +2,13 @@
<div
v-if=
"provinceView"
>
<el-form
ref=
"provinceForm"
:model=
"provinceForm"
:inline=
"true"
class=
"province"
>
<el-select
size=
"small"
v-model=
"provinceForm.provinceName"
clearable
placeholder=
"选择省份"
:style=
"
{ width: defaultWidth }" @clear="selectProvince" class="select-padding">
<el-option
v-for=
"
item in AllData"
:key=
"item.adcode
"
:label=
"item.name"
:value=
"item.name"
@
click
.
native=
"selectProvince(item)"
></el-option>
<el-option
v-for=
"
(item, index) in AllData"
:key=
"'province' + index
"
:label=
"item.name"
:value=
"item.name"
@
click
.
native=
"selectProvince(item)"
></el-option>
</el-select>
<el-select
size=
"small"
v-model=
"provinceForm.cityName"
clearable
placeholder=
"选择市"
:style=
"
{ width: defaultWidth }" @clear="selectCity" class="select-padding">
<el-option
v-for=
"
item in cityList"
:key=
"item.adcode
"
:label=
"item.name"
:value=
"item.name"
@
click
.
native=
"selectCity(item)"
></el-option>
<el-option
v-for=
"
(item, index) in cityList"
:key=
"'city' + index
"
:label=
"item.name"
:value=
"item.name"
@
click
.
native=
"selectCity(item)"
></el-option>
</el-select>
<el-select
v-if=
"subdistrict == 3"
size=
"small"
v-model=
"provinceForm.townName"
clearable
placeholder=
"选择区"
:style=
"
{ width: defaultWidth }" @clear="selectTown" class="select-padding">
<el-option
v-for=
"
item in townList"
:key=
"item.adcode
"
:label=
"item.name"
:value=
"item.name"
@
click
.
native=
"selectTown(item)"
></el-option>
<el-option
v-for=
"
(item, index) in townList"
:key=
"'town' + index
"
:label=
"item.name"
:value=
"item.name"
@
click
.
native=
"selectTown(item)"
></el-option>
</el-select>
</el-form>
</div>
...
...
@@ -149,8 +149,8 @@ export default {
this
.
provinceForm
.
townName
=
''
if
(
val
)
{
this
.
cityList
=
val
.
districts
}
else
{
val
=
''
}
else
{
val
=
''
}
// 选择省
this
.
$emit
(
'selectProvince'
,
val
)
...
...
@@ -160,8 +160,8 @@ export default {
this
.
provinceForm
.
townName
=
''
if
(
val
)
{
this
.
townList
=
val
.
districts
}
else
{
val
=
''
}
else
{
val
=
''
}
// 选择市
this
.
$emit
(
'selectCity'
,
val
)
...
...
Write
Preview
Markdown
is supported
Attach a file
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 post a comment