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选择器选择第一个城市数据不对 #3220

Open
xuhao666 opened this issue Oct 31, 2024 · 1 comment
Open

picker选择器选择第一个城市数据不对 #3220

xuhao666 opened this issue Oct 31, 2024 · 1 comment

Comments

@xuhao666
Copy link

NutUI 包名

@nutui/nutui

NutUI 版本号

4.3.7

平台

h5

重现链接

http://www.1314test.com/user/report/love

重现步骤

使用方式:
<nut-picker v-model="taCity" :columns="columnsCity" title="城市选择" @cancel="showCityPicker = false"
@confirm="handleConfirm" />

const handleConfirm = ({ selectedValue, selectedOptions }) => {
console.log("selectedValue",selectedValue, "selectedOptions",selectedOptions);
};
数据结构:[{
"text":"江苏",
"value":"32",
children:[{
"text":"南京",
"value":"3201",
},
{
"text":"无锡",
"value":"3202",
}]
}]

期望的结果是什么?

第一次选择江苏省份非第一个城市时handleConfirm方法回调中的参数应该为选中那条城市的数据

实际的结果是什么?

第一次选择时返回的数据总是该省份下的第一个城市即南京,其他省份选择也一样,已经通过断点反复调试,发现回调中的数据始终为第一个城市,再次编辑时即正常,怀疑组件内的默认值逻辑是否存在问题。城市数据从接口获取而来,格式在步骤中有标注。

环境信息

No response

其他补充信息

重现链接需要注册才可以访问有问题的页面

@yuyoux
Copy link

yuyoux commented Nov 15, 2024

一样的问题,疯了

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

No branches or pull requests

2 participants