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

自定义地址不显示 #2000

Closed
YoungHearts opened this issue Sep 18, 2017 · 14 comments
Closed

自定义地址不显示 #2000

YoungHearts opened this issue Sep 18, 2017 · 14 comments

Comments

@YoungHearts
Copy link

在重庆(500000)类里添加{ "value": "500200", "name": "县", "parent": "500000" }, { "value": "500228", "name": "梁平县", "parent": "500200" }, { "value": "500229", "name": "城口县", "parent": "500200" },
时,组件页面无法显示实际active。
vuxissue

@YoungHearts
Copy link
Author

@airyland 依次选择 重庆市--县--XX县,页面无法正确显示名称

@airyland
Copy link
Owner

对于直辖市貌似有特殊处理,因为按照官方数据它们只有一级市辖区。

@YoungHearts
Copy link
Author

YoungHearts commented Sep 18, 2017

国家统计局,按最新发布的,直辖市也有二级了。那目前最好的处理办法是什么呢? @airyland

@airyland
Copy link
Owner

看来是组件的问题,因为我看了下内置的数据和你上面这一份是一致的。

@airyland
Copy link
Owner

原来的处理是把县下面的放到了直辖市下面,忘了为什么要这样处理 😓

@YoungHearts
Copy link
Author

先手动改了,等着修复哦

@airyland
Copy link
Owner

v2.6.2

@YoungHearts
Copy link
Author

YoungHearts commented Sep 19, 2017

确认了很多次更新到v2.6.2后还是不行呢,我看你的官网却是对的。会不会官网版本与我们下载的版本内容不一致~
1111
222
333

@airyland

@airyland
Copy link
Owner

应该是一致的才对,官网例子也是直接引用 V4。我看到你的截图里县数据是正常的。

@YoungHearts
Copy link
Author

YoungHearts commented Sep 19, 2017

这个问题我发现是重庆市--县--xx不支持Value2nameFilter as value2name函数,也就是不支持传入name,其他地区都支持

不过又发现一个新的问题,选择港澳台等,后边没有区县的话,会报错。我们希望可以只显示一个港或者澳或台。 @airyland
vuxissue2

@airyland
Copy link
Owner

airyland commented Sep 19, 2017

这个没法处理啊,应该是使用者来保证数据源是正确的级数。单级的逻辑转移到组件内部处理过于复杂了。
XAddress 数据源自动为没有第三级的添加了一个值为 -- 的下一级。

@YoungHearts
Copy link
Author

正确的数据源,只有一级--
111

@airyland
Copy link
Owner

@YoungHearts 这跟数据源无关,这是组件的要求。内置的数据只有大陆地址没有后面这三个特殊的。若是数据源可以只有一级,二级,那么值也可以一级,二级,这种情况组件极难处理了。所以如果这个组件满足不了要求,你只能自己弄一个类似的了,不用这种滑动的交互应该比较好解决。

@YoungHearts
Copy link
Author

YoungHearts commented Sep 19, 2017

好的,之前那个问题在于如果初始数据传入的是string类型,重庆--县就无法渲染。其他都可以哈。
没办法比如我们这边要求就是保存string的,不保存id值-- @airyland

不知道我描述清楚没有……。比如下图,你如果传this.value2 = ["重庆市", "县", "忠县"] 就修改不了
111

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

2 participants