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

Cascader: 能把父选项的值也添加到value中么?而不是仅仅只有子选项的值,比如[1,15]这样 #6190

Open
3 tasks done
PeikyLiu opened this issue Jul 24, 2024 · 0 comments
Labels
feature request New feature or request

Comments

@PeikyLiu
Copy link

问题的清晰而简明的描述

const testOptions = [
{
value: 1,
label: '数学',
children: [
{
value: 3,
label: '小学'
},
{
value: 15,
label: '初中'
}
]
},
{
value: 2,
label: '英语',
children: [
{
value: 3,
label: '小学'
},
{
value: 15,
label: '初中'
}
]
}
] 参考这种数据类型的options,每个父选项中的子选项的值都是一样的,假如我选择的是value为2的父选项中的value为15的子选项(英语/初中),我希望我的value可以以这样的形式展现[2,15],如果是在新建的场景下,我确实可以使用update-value的回调中拿到pathValue来获取父级,但如果是一个详情页面,需要数据回显,我如何能确认我的父选项呢?

建议的解决方案

希望能将cascader的value可以增加父选项的值

备选方案

No response

附加上下文

No response

验证

  • 阅读 贡献指南
  • 阅读 文档
  • 检查是否已经存在请求相同功能的问题,以避免创建重复的问题。
@PeikyLiu PeikyLiu added the feature request New feature or request label Jul 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant