|
想使用select做一个省市区三级联动,可是为什么更新市区数据时老是提示removeView(View) is not supported in AdapterView?
- <template>
- <div style="width: 100%;height: 80px;">
- <select class="_city-select" onchange="onChange(1)">
- <option class="_city-option" for="province" selected="{{$idx==defaultCity[0]}}" value="{{$idx}}">{{$item.province}}</option>
- </select>
- <select class="_city-select" onchange="onChange(2)">
- <option class="_city-option" for="city" selected="{{$idx==defaultCity[1]}}" value="{{$idx}}">{{$item.city}}</option>
- </select>
- <select class="_city-select" onchange="onChange(3)">
- <option class="_city-option" for="district" selected="{{$idx==defaultCity[2]}}" value="{{$idx}}">{{$item.district}}</option>
- </select>
- </div>
- </template>
复制代码 从log上看市区的数据已经正常改变了,格式也是正确的。
- [{"city":"北京","district":[{"district":"北京"},{"district":"海淀"},{"district":"朝阳"},{"district":"顺义"},{"district":"怀柔"},{"district":"通州"},{"district":"昌平"},{"district":"延庆"},{"district":"丰台"},{"district":"石景山"},{"district":"大兴"},{"district":"房山"},{"district":"密云"},{"district":"门头沟"},{"district":"平谷"}]}]
- [{"district":"北京"},{"district":"海淀"},{"district":"朝阳"},{"district":"顺义"},{"district":"怀柔"},{"district":"通州"},{"district":"昌平"},{"district":"延庆"},{"district":"丰台"},{"district":"石景山"},{"district":"大兴"},{"district":"房山"},{"district":"密云"},{"district":"门头沟"},{"district":"平谷"}]
- 0,0,0
- [{"city":"北京","district":[{"district":"北京"},{"district":"海淀"},{"district":"朝阳"},{"district":"顺义"},{"district":"怀柔"},{"district":"通州"},{"district":"昌平"},{"district":"延庆"},{"district":"丰台"},{"district":"石景山"},{"district":"大兴"},{"district":"房山"},{"district":"密云"},{"district":"门头沟"},{"district":"平谷"}]}]
- [{"district":"北京"},{"district":"海淀"},{"district":"朝阳"},{"district":"顺义"},{"district":"怀柔"},{"district":"通州"},{"district":"昌平"},{"district":"延庆"},{"district":"丰台"},{"district":"石景山"},{"district":"大兴"},{"district":"房山"},{"district":"密云"},{"district":"门头沟"},{"district":"平谷"}]
- 0,0,0
- [{"city":"北京","district":[{"district":"北京"},{"district":"海淀"},{"district":"朝阳"},{"district":"顺义"},{"district":"怀柔"},{"district":"通州"},{"district":"昌平"},{"district":"延庆"},{"district":"丰台"},{"district":"石景山"},{"district":"大兴"},{"district":"房山"},{"district":"密云"},{"district":"门头沟"},{"district":"平谷"}]}]
- [{"district":"北京"},{"district":"海淀"},{"district":"朝阳"},{"district":"顺义"},{"district":"怀柔"},{"district":"通州"},{"district":"昌平"},{"district":"延庆"},{"district":"丰台"},{"district":"石景山"},{"district":"大兴"},{"district":"房山"},{"district":"密云"},{"district":"门头沟"},{"district":"平谷"}]
- 0,0,0
- [{"city":"上海","district":[{"district":"上海"},{"district":"闵行"},{"district":"宝山"},{"district":"嘉定"},{"district":"浦东南汇"},{"district":"金山"},{"district":"青浦"},{"district":"松江"},{"district":"奉贤"},{"district":"崇明"},{"district":"徐家汇"},{"district":"浦东"}]}]
- [{"district":"上海"},{"district":"闵行"},{"district":"宝山"},{"district":"嘉定"},{"district":"浦东南汇"},{"district":"金山"},{"district":"青浦"},{"district":"松江"},{"district":"奉贤"},{"district":"崇明"},{"district":"徐家汇"},{"district":"浦东"}]
- 1,0,0
复制代码 可是还是报不能remove的错误!!字面上的理解是不支持removeView,可是不改变原来的数据怎么实现三级联动???希望有知道原因的人能告诉我一下,谢谢了!或者有其他实现的方法也麻烦告诉我一下!
|
|