格式化
This commit is contained in:
parent
9ce9d66cbe
commit
70b082a208
@ -83,7 +83,11 @@ function recursiveNodeClick(node: TreeData) {
|
||||
}
|
||||
|
||||
function handleChange(checked: boolean, node: TreeData) {
|
||||
props.tree.setCheckedKeys(checked, props.checkStrictly || props.selectParent, node);
|
||||
props.tree.setCheckedKeys(
|
||||
checked,
|
||||
props.checkStrictly || props.selectParent,
|
||||
node
|
||||
);
|
||||
}
|
||||
|
||||
function handleIconClick(node: TreeData) {
|
||||
@ -129,14 +133,14 @@ const isChildAllSelected = computed(() => {
|
||||
}
|
||||
|
||||
return (node: TreeData): boolean => {
|
||||
console.log(props.selectParent)
|
||||
console.log(props.selectParent);
|
||||
if (props.checkStrictly) {
|
||||
return false;
|
||||
} else if (props.selectParent) {
|
||||
let res = _isChildAllSelected(node);
|
||||
return res;
|
||||
} else {
|
||||
return false
|
||||
return false;
|
||||
}
|
||||
};
|
||||
});
|
||||
|
@ -66,7 +66,7 @@ const props = withDefaults(defineProps<TreeProps>(), {
|
||||
title: "title",
|
||||
};
|
||||
},
|
||||
selectParent:false
|
||||
selectParent: false,
|
||||
});
|
||||
|
||||
const slots = useSlots();
|
||||
|
@ -94,7 +94,7 @@ class Tree {
|
||||
checkStrictly,
|
||||
replaceFields: { children, id, title },
|
||||
} = this.config;
|
||||
console.log(origin,"origin")
|
||||
console.log(origin, "origin");
|
||||
const nodeKey = Reflect.get(origin, id);
|
||||
const nodeTitle = Reflect.get(origin, title);
|
||||
const nodeChildren = Reflect.get(origin, children);
|
||||
@ -112,7 +112,7 @@ class Tree {
|
||||
isChecked: false,
|
||||
isLeaf: false,
|
||||
hasNextSibling: hasNextSibling,
|
||||
parentNode: parentNode || null
|
||||
parentNode: parentNode || null,
|
||||
});
|
||||
|
||||
node.isDisabled = nodeDisabled;
|
||||
@ -137,7 +137,7 @@ class Tree {
|
||||
}
|
||||
|
||||
setChildrenChecked(checked: boolean, nodes: TreeData[]) {
|
||||
console.log("走赋值子节点了")
|
||||
console.log("走赋值子节点了");
|
||||
var ableCount = 0;
|
||||
var checkCount = 0;
|
||||
const len = nodes.length;
|
||||
@ -164,7 +164,7 @@ class Tree {
|
||||
}
|
||||
|
||||
setParentChecked(checked: boolean, parent: TreeData) {
|
||||
console.log("走赋值父节点了")
|
||||
console.log("走赋值父节点了");
|
||||
if (!parent) {
|
||||
return;
|
||||
}
|
||||
@ -185,7 +185,7 @@ class Tree {
|
||||
node: TreeData
|
||||
) {
|
||||
node.isChecked = checked;
|
||||
console.log(node,checkStrictly,186)
|
||||
console.log(node, checkStrictly, 186);
|
||||
if (!checkStrictly) {
|
||||
if (node.parentNode) {
|
||||
this.setParentChecked(checked, node.parentNode);
|
||||
|
Loading…
Reference in New Issue
Block a user