test tree

This commit is contained in:
Theluyuan 2023-05-15 11:34:14 +08:00
parent d9e6e75275
commit d9e8704a6b
4 changed files with 12 additions and 6 deletions

View File

@ -80,8 +80,10 @@ const _sfc_main$1 = defineComponent({
if (item.isChecked)
childSelectNum++;
}
if (childSelectNum > 0)
node.isChecked = true;
if (!props.selectParent) {
if (childSelectNum > 0)
node.isChecked = true;
}
if (childSelectNum == node.children.length) {
for (const item of node.children) {
res = _isChildAllSelected(item);

View File

@ -17677,8 +17677,10 @@ const _sfc_main$K = defineComponent({
if (item.isChecked)
childSelectNum++;
}
if (childSelectNum > 0)
node.isChecked = true;
if (!props.selectParent) {
if (childSelectNum > 0)
node.isChecked = true;
}
if (childSelectNum == node.children.length) {
for (const item of node.children) {
res = _isChildAllSelected(item);

View File

@ -114,7 +114,9 @@ const isChildAllSelected = computed(() => {
for (const item of node.children) {
if (item.isChecked) childSelectNum++;
}
if (childSelectNum > 0) node.isChecked = true; // checkedKeys
if(!props.selectParent){
if (childSelectNum > 0) node.isChecked = true; // checkedKeys
}
if (childSelectNum == node.children.length) {
//
for (const item of node.children) {

File diff suppressed because one or more lines are too long