add 树型框可以不半选父级
This commit is contained in:
@@ -24,7 +24,8 @@ const _sfc_main$1 = 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 }) {
|
||||
@@ -97,9 +98,11 @@ const _sfc_main$1 = defineComponent({
|
||||
return (node) => {
|
||||
if (props.checkStrictly) {
|
||||
return false;
|
||||
} else {
|
||||
} else if (props.selectParent) {
|
||||
let res = _isChildAllSelected(node);
|
||||
return res;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
};
|
||||
});
|
||||
@@ -166,6 +169,7 @@ const _sfc_main$1 = defineComponent({
|
||||
checkStrictly: __props.checkStrictly,
|
||||
"only-icon-control": __props.onlyIconControl,
|
||||
hideicon: props.hideicon,
|
||||
"select-parent": props.selectParent,
|
||||
onNodeClick: recursiveNodeClick
|
||||
}, createSlots({ _: 2 }, [
|
||||
_ctx.$slots.title ? {
|
||||
@@ -177,7 +181,7 @@ const _sfc_main$1 = 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
|
||||
@@ -383,7 +387,8 @@ const _sfc_main = defineComponent({
|
||||
title: "title"
|
||||
};
|
||||
} },
|
||||
hideicon: { type: Boolean }
|
||||
hideicon: { type: Boolean },
|
||||
selectParent: { type: Boolean, default: true }
|
||||
},
|
||||
emits: ["update:checkedKeys", "update:expandKeys", "node-click"],
|
||||
setup(__props, { emit }) {
|
||||
@@ -446,7 +451,8 @@ const _sfc_main = 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",
|
||||
@@ -455,7 +461,7 @@ const _sfc_main = 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);
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user