HarmonyOS 三级联动
[{"code":"110000","name":"北京市","level":"省级","children":[{"code":"110100","name":"北京市","level":"地级","children":[{"code":"110101","name":"东城区","level":"县级","children":[]},{"code":"110102","name":"西城区","level":"县级","children":[]},{"code":"110105","name":"朝阳区","level":"县级","children":[]},{"code":"110106","name":"丰台区","level":"县级","children":[]},{"code":"110107","name":"石景山区","level":"县级","children":[]},{"code":"110108","name":"海淀区","level":"县级","children":[]},{"code":"110109","name":"门头沟区","level":"县级","children":[]},{"code":"110111","name":"房山区","level":"县级","children":[]},{"code":"110112","name":"通州区","level":"县级","children":[]},{"code":"110113","name":"顺义区","level":"县级","children":[]},{"code":"110114","name":"昌平区","level":"县级","children":[]},{"code":"110115","name":"大兴区","level":"县级","children":[]},{"code":"110116","name":"怀柔区","level":"县级","children":[]},{"code":"110117","name":"平谷区","level":"县级","children":[]},{"code":"110118","name":"密云区","level":"县级","children":[]},{"code":"110119","name":"延庆区","level":"县级","children":[]},{"code":"110100","name":"北京市本级","level":"地级","children":[]}]}]},{"code":"120000","name":"天津市","level":"省级","children":[{"code":"120100","name":"天津市","level":"地级","children":[{"code":"120103","name":"河西区","level":"县级","children":[]},{"code":"120101","name":"和平区","level":"县级","children":[]},{"code":"120102","name":"河东区","level":"县级","children":[]},{"code":"120104","name":"南开区","level":"县级","children":[]},{"code":"120105","name":"河北区","level":"县级","children":[]},{"code":"120106","name":"红桥区","level":"县级","children":[]},{"code":"120110","name":"东丽区","level":"县级","children":[]},{"code":"120111","name":"西青区","level":"县级","children":[]},{"code":"120112","name":"津南区","level":"县级","children":[]},{"code":"120113","name":"北辰区","level":"县级","children":[]},{"code":"120114","name":"武清区","level":"县级","children":[]},{"code":"120115","name":"宝坻区","level":"县级","children":[]},{"code":"120116","name":"滨海新区","level":"县级","children":[]},{"code":"120117","name":"宁河区","level":"县级","children":[]},{"code":"120118","name":"静海区","level":"县级","children":[]},{"code":"120119","name":"蓟州区","level":"县级","children":[]},{"code":"120100","name":"天津市本级","level":"地级","children":[]}]}]},{"code":"130000","name":"河北省","level":"省级","children":[{"code":"130100","name":"石家庄市","level":"地级","children":[{"code":"130102","name":"长安区","level":"县级","children":[]},{"code":"130104","name":"桥西区","level":"县级","children":[]},{"code":"130105","name":"新华区","level":"县级","children":[]},{"code":"130107","name":"井陉矿区","level":"县级","children":[]},{"code":"130108","name":"裕华区","level":"县级","children":[]},{"code":"130109","name":"藁城区","level":"县级","children":[]},{"code":"130110","name":"鹿泉区","level":"县级","children":[]},{"code":"130111","name":"栾城区","level":"县级","children":[]},{"code":"130181","name":"辛集市","level":"县级","children":[]},{"code":"130183","name":"晋州市","level":"县级","children":[]},{"code":"130184","name":"新乐市","level":"县级","children":[]},{"code":"130121","name":"井陉县","level":"县级","children":[]}
使用此数据和使用此类型
export type Department = {
code: string;
name: string;
};
export type Region = Department & {
level: string;
children?: Array<Region>;
};
进行自定义封装实现三级联动的效果也是可以的,有样例吗?
- 使用TextPicker组件和上面的数据及类型实现三级联动,(两种实现方式的前提都是要用此数据结构,以及类型定义)
HarmonyOS
赞
收藏 0
回答 1
待解决
相关问题
HarmonyOS 请提供一个三级联动的相关demo
371浏览 • 1回复 待解决
HarmonyOS 三级省市县地址级联选择demo
198浏览 • 1回复 待解决
ArkTS语言编写的省市区三级联动三方模块哪里有??
2521浏览 • 1回复 待解决
HarmonyOS 如何做一个选择三级联动的省市区选择器
212浏览 • 1回复 待解决
HarmonyOS 需要二级联动的demo
486浏览 • 1回复 待解决
Image组件是否有三级缓存策略
1129浏览 • 1回复 待解决
#鸿蒙通关秘籍#如何在HarmonyOS中实现二级联动的滑动效果?
235浏览 • 1回复 待解决
#鸿蒙通关秘籍#实现二级联动的基础思路是什么?
297浏览 • 1回复 待解决
#鸿蒙通关秘籍#如何提升HarmonyOS中二级联动功能的性能?
173浏览 • 1回复 待解决
HarmonyOS TextPicker多级联动的展示问题
182浏览 • 1回复 待解决
HarmonyOS TextPickerDialog多级联动问题
135浏览 • 1回复 待解决
#鸿蒙通关秘籍#如何实现二级联动的List组件数据懒加载?
185浏览 • 0回复 待解决
#鸿蒙通关秘籍#如何实现一级列表点击联动二级列表?
320浏览 • 1回复 待解决
#鸿蒙通关秘籍#如何通过滑动二级列表联动一级列表?
273浏览 • 1回复 待解决
HarmonyOS 装饰器嵌套二级,列表item控件显示没有联动
112浏览 • 1回复 待解决
HarmonyOS 如何实现级联选择省市区
684浏览 • 1回复 待解决
HarmonyOS 列表联动交互
134浏览 • 1回复 待解决
HarmonyOS 联动组件咨询
420浏览 • 1回复 待解决
HarmonyOS List联动滑动
144浏览 • 1回复 待解决
#鸿蒙通关秘籍#在HarmonyOS中实现二级列表滚动联动时常见的性能优化方法有哪些?
230浏览 • 0回复 待解决
HarmonyOS 官方或者第三方是否有五级地区选择空间
167浏览 • 1回复 待解决
HarmonyOS list web scroll 联动
101浏览 • 1回复 待解决
滚动视图联动:实现多List联动滚动,横竖向滚动
1617浏览 • 1回复 待解决
HarmonyOS中的多设备联动如何实现?
327浏览 • 0回复 待解决
HarmonyOS Video组件与Slider组件联动
46浏览 • 1回复 待解决
可以参考以下demo: