增加v-model

This commit is contained in:
aixianling
2021-12-30 17:36:27 +08:00
parent 85a3611acf
commit b6657ccfbd

View File

@@ -50,7 +50,12 @@ import {mapState} from 'vuex'
export default {
name: 'AiAreaPicker',
components: {AiCell, AiSearchPopup},
model: {
prop: "value",
event: "select"
},
props: {
value: {default: ""},
areaId: {default: ''},
name: {default: ''},
all: Boolean,
@@ -96,6 +101,9 @@ export default {
areaId(v) {
v && this.getFullArea()
},
value(v) {
v && this.handleInit()
}
},
methods: {
getFullArea() {
@@ -162,7 +170,7 @@ export default {
}
},
handleInit() {
this.index = this.areaId
this.index = this.value || this.areaId
this.getFullArea().then(() => {
if (this.all && !this.currentArea.id) this.getProvinces()
else this.getChildAreas(this.currentArea.id)