-
Notifications
You must be signed in to change notification settings - Fork 288
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
[Cascader] 设置Value值无效 #2902
Comments
👋 @WEBTMM,感谢给 TDesign 提出了 issue。 |
@WEBTMM 收到反馈,我来看看~ |
@WEBTMM hello 我这边初步在attached阶段使用setTimeout模拟接口异步数据,并在此同步赋值给value, cascader组件能正确响应,未能复现你的问题~。方便的话 希望能提供一下可复现代码片段 |
@anlyyao 试过了,确实不行,setData() 后无效,具体如下 正在用呢,赶紧发个版本吧,或者给个临时方法,我先用一下 忘记说了,直接复制的官方提供的例子测试的 |
这个功能解决了什么问题
使用场景:编辑用户资料,通过接口数据返回用户已选择的省市区信息,通过接口数据结果设置Cascader Value
预期效果:当用户点击省市区时默认选中数据接口返回的省市区选项
实际效果:Value本地写死可以默认选中项,通过接口数据设置Value无效
接口数据返回格式为:district: { code: 230108, name: "平房区" }
Value设置值为:district.code
你建议的方案是什么
通过数据接口Value可以设置默认选中项,更加方便用户以上次保存信息为基础变更新的选项信息
The text was updated successfully, but these errors were encountered: