Open sscfaith opened 1 year ago
tree可以正常显示,但是选中的值,在select上是undefined,v-model绑定的值也是undefined,选中的个数正常,值估计是绑定的props没有映射上
:props="{ label: 'name', value: 'id' }"
问题出在这里。文档上注明了TreeSelect是el-tree和el-select的结合体
,props
中没有value
属性。因为show-checkbox
属性为true
时,会使用props.nodeKey || props.valueKey || 'value'
查找选择的选项,所以简单点,加上node-key="id"
就好了。
谢谢大佬,解决了我的问题****
Bug Type:
Component
Environment
3.2.47
2.3.3
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/111.0.0.0 Safari/537.36
Vite
Reproduction
Related Component
el-tree-select
Reproduction Link
Element Plus Playground
Steps to reproduce
链接
What is Expected?
props有效
What is actually happening?
props无效
Additional comments
(empty)