Skip to content

TreeSelect树选择设置treeNodeLabelProp属性无效 #1161

@gjf450005950

Description

@gjf450005950
  • 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 值

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions