Commit 6445b3a2 by 陈超

T

parent fbbf2dc1
...@@ -178,11 +178,7 @@ ...@@ -178,11 +178,7 @@
if(p.children.length == 0) { if(p.children.length == 0) {
that.getCity(p.id, r => { that.getCity(p.id, r => {
p.children = r.map(r => { return { text: r.title, id: r.area_id, children: [] } }) p.children = r.map(r => { return { text: r.title, id: r.area_id, children: [] } })
if(p.children.length > 0) {
that.onCityChange(picker, p.children[0]) that.onCityChange(picker, p.children[0])
} else {
that.columns = [].concat(that.columns)
}
}) })
} else { } else {
picker.setColumnValues(1, p.children) picker.setColumnValues(1, p.children)
...@@ -195,6 +191,7 @@ ...@@ -195,6 +191,7 @@
that.getArea(c.id, r => { that.getArea(c.id, r => {
c.children = r.map(r => { return { text: r.title, id: r.area_id } }) c.children = r.map(r => { return { text: r.title, id: r.area_id } })
picker.setColumnValues(2, c.children) picker.setColumnValues(2, c.children)
that.columns = [].concat(that.columns)
}) })
} else { } else {
picker.setColumnValues(2, c.children) picker.setColumnValues(2, c.children)
...@@ -205,7 +202,6 @@ ...@@ -205,7 +202,6 @@
that.showPicker = true that.showPicker = true
if(that.columns[0].children.length == 0) { if(that.columns[0].children.length == 0) {
that.$nextTick(() => { that.$nextTick(() => {
console.log(that.$refs.picker)
that.onProvinceChange(that.$refs.picker, that.columns[0]) that.onProvinceChange(that.$refs.picker, that.columns[0])
}) })
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment