Skip to content

树型选择控件中使用treeNodeFilterProp设置自定义属性进行筛选时,筛选结果不正确 #1885

@892598640

Description

@892598640
  • I have searched the issues of this repository and believe that this is not a duplicate.

Version

1.4.12

Environment

WIN10 chrome最新版 vue2.5.2

Reproduction link

http://118.89.191.69:9528/antbug/index.html#/

Steps to reproduce

树型选择控件中使用treeNodeFilterProp设置自定义属性进行筛选时,筛选结果不正确

代码如下:
html:

<a-tree-select
  treeNodeFilterProp="name"
  allowClear
  style="width: 70%"
  :treeData="treeDataTest"
  :value="val"
  treeCheckable
  :dropdownStyle="{ maxHeight: '60vh' }"
  :filterTreeNode="fillterFUN"
>
  <span style="color: #08c" slot="title" slot-scope="data">
    {{ data.name }}
  </span>
</a-tree-select>

js:

treeDataTest: [
{
scopedSlots: {
title: "title"
},
name: "node2",
value: "0-1",
key: "0-1"
}
]

fillterFUN(searchVal, treeNode) {
return treeNode.data.props.name.includes(searchVal);
}

如果使用filterTreeNode自定义筛选后筛选功能正常

What is expected?

出现正确的搜索结果

What is actually happening?

出现了错误的搜索结果

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