add 树型框可以不半选父级

This commit is contained in:
2023-05-12 15:56:44 +08:00
parent f87a5bb70a
commit 72e79b3361
5 changed files with 34 additions and 15 deletions

View File

@@ -17621,7 +17621,8 @@ const _sfc_main$K = defineComponent({
checkStrictly: { type: [Boolean, String] },
collapseTransition: { type: Boolean },
onlyIconControl: { type: Boolean },
hideicon: { type: Boolean }
hideicon: { type: Boolean },
selectParent: { type: Boolean }
},
emits: ["node-click"],
setup(__props, { emit }) {
@@ -17694,9 +17695,11 @@ const _sfc_main$K = defineComponent({
return (node) => {
if (props.checkStrictly) {
return false;
} else {
} else if (props.selectParent) {
let res = _isChildAllSelected(node);
return res;
} else {
return false;
}
};
});
@@ -17763,6 +17766,7 @@ const _sfc_main$K = defineComponent({
checkStrictly: __props.checkStrictly,
"only-icon-control": __props.onlyIconControl,
hideicon: props.hideicon,
"select-parent": props.selectParent,
onNodeClick: recursiveNodeClick
}, createSlots({ _: 2 }, [
_ctx.$slots.title ? {
@@ -17774,7 +17778,7 @@ const _sfc_main$K = defineComponent({
]),
key: "0"
} : void 0
]), 1032, ["tree", "node-list", "show-checkbox", "show-line", "selected-key", "collapse-transition", "checkStrictly", "only-icon-control", "hideicon"])
]), 1032, ["tree", "node-list", "show-checkbox", "show-line", "selected-key", "collapse-transition", "checkStrictly", "only-icon-control", "hideicon", "select-parent"])
])) : createCommentVNode("", true)
]),
_: 2
@@ -17980,7 +17984,8 @@ const _sfc_main$J = defineComponent({
title: "title"
};
} },
hideicon: { type: Boolean }
hideicon: { type: Boolean },
selectParent: { type: Boolean, default: true }
},
emits: ["update:checkedKeys", "update:expandKeys", "node-click"],
setup(__props, { emit }) {
@@ -18043,7 +18048,8 @@ const _sfc_main$J = defineComponent({
"collapse-transition": __props.collapseTransition,
"only-icon-control": __props.onlyIconControl,
onNodeClick: handleClick,
hideicon: props.hideicon
hideicon: props.hideicon,
selectParent: props.selectParent
}, createSlots({ _: 2 }, [
_ctx.$slots.title ? {
name: "title",
@@ -18052,7 +18058,7 @@ const _sfc_main$J = defineComponent({
]),
key: "0"
} : void 0
]), 1032, ["tree", "node-list", "show-checkbox", "show-line", "selectedKey", "check-strictly", "collapse-transition", "only-icon-control", "hideicon"])
]), 1032, ["tree", "node-list", "show-checkbox", "show-line", "selectedKey", "check-strictly", "collapse-transition", "only-icon-control", "hideicon", "selectParent"])
], 2);
};
}