Skip to content

When the tree component has the same key, consecutive selection of subtrees will clear another set of selections #5261

@wangjiahui5986

Description

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

Version

3.0.0-beta.9

Environment

操作系统mac,浏览器chrome,vue3.2.8

Reproduction link

http://nolink

Steps to reproduce

<Tree
v-model:selectedKeys="selectedKeys"
:tree-data="data"
show-icon
checkable
:selectable="false"

const data = [{
title: 'parent 1',
key: '0-0',
children: [{
title: 'parent 1-0',
key: '0-0-0',
children: [{
title: 'leaf',
key: '0-0-0-0',
}, {
title: 'leaf',
key: '0-0-0-1',
}],
}, {
title: 'parent 1-1',
key: '0-0-1',
children: [{
key: '0-0-1-0',
title: 'sss',
},{
title: 'leaf',
key: '0-0-0-0',
}, {
title: 'leaf',
key: '0-0-0-1',
}]
}],
}];

BUG1

1.check parent 1-0下 leaf(0-0-0-0)节点
parent 1-1 下 leaf(0-0-0-0)节点被勾选
2.check parent 1-0下 leaf(0-0-0-1)节点
parent 1-1 下 leaf(0-0-0-1)节点被勾选
取消check leaf(0-0-0-0)节点
此时check全部消失

BUG2

1.check parent 1-0
parent 1-1下 leaf(0-0-0-0),leaf(0-0-0-1)全部被勾选
此时取消leaf(0-0-0-0)勾选,再取消leaf(0-0-0-1)勾选,leaf(0-0-0-0)被再次反选

What is expected?

解决bug

What is actually happening?

错误的勾选

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions