Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

建议: Picker组件联动时,数据第一列数据的parent值建议改为复杂字符串或可自定义 #2589

Closed
heaven2049 opened this issue Apr 3, 2018 · 3 comments

Comments

@heaven2049
Copy link

heaven2049 commented Apr 3, 2018

Picker组件联动情况下,data数组中第一列的parent值可为空 或 0 或者 '0'。

实际使用时,封装数据过程中可能出现parent为0的情况。(如以id为键构建数组,某节点的id恰好为0),那实际使用时需要特殊处理0的情况,略麻烦。

建议此默认值改为可通过props传递 |为空 | 一个较复杂字符串 表示第一列。

@heaven2049 heaven2049 changed the title Picker组件联动时,数据第一列数据的parent值建议改为复杂字符串或可自定义 建议: Picker组件联动时,数据第一列数据的parent值建议改为复杂字符串或可自定义 Apr 3, 2018
@xusenlin
Copy link

xusenlin commented Nov 13, 2018

还是没有找到这个功能,我们返回的城市列表北京的关键code就是0,导致北京全部地区变父元素。父及留空也会导致子级parent为0时变父级的情况

@heaven2049
Copy link
Author

还是没有找到这个功能,我们返回的城市列表北京的关键code就是0,导致北京全部地区变父元素。父及留空也会导致子级parent为0时变父级的情况

这个功能issue3月份提的,并没上线,个人对Vux不熟悉所以没有自行修改。

建议自行处理一下你的数据,比如赋值给Picker前code加一个前缀如:abcd_0,在实际保存时再移除前缀abcd_。

@xusenlin
Copy link

xusenlin commented Nov 16, 2018 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants