Skip to content

Commit 44ac97d

Browse files
authored
fix(picker): regional selection example shows data exception (#3487)
1 parent af5abc4 commit 44ac97d

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

src/picker/_example/area/index.js

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,14 +100,18 @@ Component({
100100

101101
lifetimes: {
102102
ready() {
103+
this.init();
104+
},
105+
},
106+
107+
methods: {
108+
init() {
103109
const { provinces } = this.data;
104110
const { cities, counties } = this.getCities(provinces[0].value);
105111

106112
this.setData({ cities, counties });
107113
},
108-
},
109114

110-
methods: {
111115
onColumnChange(e) {
112116
console.log('pick:', e.detail);
113117
const { column, index } = e.detail;
@@ -159,6 +163,9 @@ Component({
159163
this.setData({
160164
areaVisible: false,
161165
});
166+
167+
if (this.data.areaValue.length) return;
168+
this.init();
162169
},
163170

164171
onAreaPicker() {

0 commit comments

Comments
 (0)