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] 接口获取columns后 点击确定报错TypeError: Cannot read properties of undefined (reading 'label') #1512

Closed
jetHall opened this issue Jul 25, 2024 · 2 comments · Fixed by #1556

Comments

@jetHall
Copy link

jetHall commented Jul 25, 2024

tdesign-mobile-vue 版本

1.3.2

重现链接

No response

重现步骤


const examineStation = reactive({
show: false,
examineStationId: ref([]),
});
let approvalUnitList:any = ref([])
const listApprovalUnit = async (regionId:any) => {
const res = await http.get('organization/listApprovalUnit',{regionId})
res?.map((item: any) => {
item.value = item.id
item.label = item.organizationName
return item
})
approvalUnitList.value.push(res)
}

报错信息:
TypeError: Cannot read properties of undefined (reading 'label')
at tdesign-mobile-vue.js?v=923cba1e:17131:21
at Array.map ()
at handleConfirm2 (tdesign-mobile-vue.js?v=923cba1e:17130:26)
at callWithErrorHandling (chunk-U6BEPC57.js?v=923cba1e:1659:19)
at callWithAsyncErrorHandling (chunk-U6BEPC57.js?v=923cba1e:1666:17)
at HTMLDivElement.invoker (chunk-U6BEPC57.js?v=923cba1e:10297:5)

期望结果

点击确定不报错

实际结果

No response

框架版本

No response

浏览器版本

No response

系统版本

No response

Node版本

No response

补充说明

No response

Copy link
Contributor

👋 @jetHall,感谢给 TDesign 提出了 issue。
请根据 issue 模版确保背景信息的完善,我们将调查并尽快回复你。

@zhanglaoban2633
Copy link

仔细看文档,你需要给columns套一层数组才能使用、我也提了这个问题、单选picker为什么要两层数组、其他picker都是正常的

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

Successfully merging a pull request may close this issue.

2 participants