Ant-design-vue: TreeSelect树选择设置treeNodeLabelProp属性无效

Created on 6 Sep 2019  ·  8Comments  ·  Source: vueComponent/ant-design-vue

  • [x] I have searched the issues of this repository and believe that this is not a duplicate.

Version

1.3.16

Environment

"ant-design-vue": "1.3.16", "vue": "^2.5.22", Chrome:版本 74.0.3729.108(正式版本) (64 位)

Reproduction link

Edit on CodeSandbox

Steps to reproduce

设置 treeNodeLabelProp 属性

<a-tree-select style="width: 300px"
:treeData="treeData"
treeNodeLabelProp="yourCustomName">
</a-tree-select>
const treeData = [
{
title: "Node1",
value: "0-0",
key: "0-0",
yourCustomName: "Node1",
children: [
{
title: "0-0-1",
value: "0-0-1",
key: "0-0-1",
yourCustomName: "Node1 > 0-0-1"
},
{
title: "Child Node2",
value: "0-0-2",
key: "0-0-2",
yourCustomName: "Node1 > Child Node2"
}
]
},
{
title: "Node2",
value: "0-1",
key: "0-1",
yourCustomName: "Node2"
}
];
export default {
data() {
return {
treeData
};
}
};

What is expected?

选择后显示 yourCustomName 值

What is actually happening?

选择后显示 value 值

Accept enhancement

Most helpful comment

暂时仅支持 title、label、value 属性

All 8 comments

我也发现这个问题了, 你有没有什么解决方案?

没有,跟了下源码没看明白

测试了下1.4.0-beta.0 版本,问题仍在。

+1

"ant-design-vue": "1.4.1", 问题仍在

暂时仅支持 title、label、value 属性

image
za在tree-select中临时调整不知可以否,该部分规范能否告知,我想支持修改

v1.5 问题依然在

Was this page helpful?
0 / 5 - 0 ratings