diff --git a/src/components/AiAreaPicker.vue b/src/components/AiAreaPicker.vue index ab4ba0a4..77c25890 100644 --- a/src/components/AiAreaPicker.vue +++ b/src/components/AiAreaPicker.vue @@ -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)