test tree

This commit is contained in:
2023-05-15 09:51:49 +08:00
parent 5400ed7cdc
commit 4b56b2b09c
6 changed files with 69 additions and 86 deletions

View File

@@ -17650,7 +17650,7 @@ const _sfc_main$K = defineComponent({
emit("node-click", node);
}
function handleChange(checked, node) {
props.tree.setCheckedKeys(checked, props.checkStrictly, node);
props.tree.setCheckedKeys(checked, props.checkStrictly && props.selectParent, node);
}
function handleIconClick(node) {
node.isLeaf = !node.isLeaf;
@@ -17831,7 +17831,6 @@ class Tree {
const nodeTitle = Reflect.get(origin, title);
const nodeChildren = Reflect.get(origin, children);
const nodeDisabled = !!Reflect.get(origin, "disabled");
const selectParent = !!Reflect.get(origin, "selectParent");
const nodeIsLeaf = !!Reflect.get(origin, "spread");
const parentNode = nodeMap.get(parentKey);
const node = Object.assign({}, origin, {
@@ -17844,8 +17843,7 @@ class Tree {
isChecked: false,
isLeaf: false,
hasNextSibling,
parentNode: parentNode || null,
selectParent
parentNode: parentNode || null
});
node.isDisabled = nodeDisabled;
node.isChecked = checkedKeys.includes(nodeKey);
@@ -17902,9 +17900,6 @@ class Tree {
setCheckedKeys(checked, checkStrictly, node) {
node.isChecked = checked;
console.log(node);
if (node.selectParent) {
return false;
}
if (!checkStrictly) {
if (node.parentNode) {
this.setParentChecked(checked, node.parentNode);