fix tree hideicon
This commit is contained in:
parent
e293b80814
commit
eab2a7b52e
@ -23,7 +23,8 @@ const _sfc_main$1 = defineComponent({
|
||||
selectedKey: null,
|
||||
checkStrictly: { type: [Boolean, String] },
|
||||
collapseTransition: { type: Boolean },
|
||||
onlyIconControl: { type: Boolean }
|
||||
onlyIconControl: { type: Boolean },
|
||||
hideicon: { type: Boolean }
|
||||
},
|
||||
emits: ["node-click"],
|
||||
setup(__props, { emit }) {
|
||||
@ -42,6 +43,9 @@ const _sfc_main$1 = defineComponent({
|
||||
if (node.children.length !== 0) {
|
||||
return !node.isLeaf ? "layui-icon-addition" : "layui-icon-subtraction";
|
||||
}
|
||||
if (props.hideicon) {
|
||||
return "";
|
||||
}
|
||||
return "layui-icon-file";
|
||||
};
|
||||
function recursiveNodeClick(node) {
|
||||
@ -161,6 +165,7 @@ const _sfc_main$1 = defineComponent({
|
||||
"collapse-transition": __props.collapseTransition,
|
||||
checkStrictly: __props.checkStrictly,
|
||||
"only-icon-control": __props.onlyIconControl,
|
||||
hideicon: props.hideicon,
|
||||
onNodeClick: recursiveNodeClick
|
||||
}, createSlots({ _: 2 }, [
|
||||
_ctx.$slots.title ? {
|
||||
@ -172,7 +177,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"])
|
||||
]), 1032, ["tree", "node-list", "show-checkbox", "show-line", "selected-key", "collapse-transition", "checkStrictly", "only-icon-control", "hideicon"])
|
||||
])) : createCommentVNode("", true)
|
||||
]),
|
||||
_: 2
|
||||
@ -377,7 +382,8 @@ const _sfc_main = defineComponent({
|
||||
children: "children",
|
||||
title: "title"
|
||||
};
|
||||
} }
|
||||
} },
|
||||
hideicon: { type: Boolean }
|
||||
},
|
||||
emits: ["update:checkedKeys", "update:expandKeys", "node-click"],
|
||||
setup(__props, { emit }) {
|
||||
@ -439,7 +445,8 @@ const _sfc_main = defineComponent({
|
||||
"check-strictly": __props.checkStrictly,
|
||||
"collapse-transition": __props.collapseTransition,
|
||||
"only-icon-control": __props.onlyIconControl,
|
||||
onNodeClick: handleClick
|
||||
onNodeClick: handleClick,
|
||||
hideicon: props.hideicon
|
||||
}, createSlots({ _: 2 }, [
|
||||
_ctx.$slots.title ? {
|
||||
name: "title",
|
||||
@ -448,7 +455,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"])
|
||||
]), 1032, ["tree", "node-list", "show-checkbox", "show-line", "selectedKey", "check-strictly", "collapse-transition", "only-icon-control", "hideicon"])
|
||||
], 2);
|
||||
};
|
||||
}
|
||||
|
17
lib/index.js
17
lib/index.js
@ -17620,7 +17620,8 @@ const _sfc_main$K = defineComponent({
|
||||
selectedKey: null,
|
||||
checkStrictly: { type: [Boolean, String] },
|
||||
collapseTransition: { type: Boolean },
|
||||
onlyIconControl: { type: Boolean }
|
||||
onlyIconControl: { type: Boolean },
|
||||
hideicon: { type: Boolean }
|
||||
},
|
||||
emits: ["node-click"],
|
||||
setup(__props, { emit }) {
|
||||
@ -17639,6 +17640,9 @@ const _sfc_main$K = defineComponent({
|
||||
if (node.children.length !== 0) {
|
||||
return !node.isLeaf ? "layui-icon-addition" : "layui-icon-subtraction";
|
||||
}
|
||||
if (props.hideicon) {
|
||||
return "";
|
||||
}
|
||||
return "layui-icon-file";
|
||||
};
|
||||
function recursiveNodeClick(node) {
|
||||
@ -17758,6 +17762,7 @@ const _sfc_main$K = defineComponent({
|
||||
"collapse-transition": __props.collapseTransition,
|
||||
checkStrictly: __props.checkStrictly,
|
||||
"only-icon-control": __props.onlyIconControl,
|
||||
hideicon: props.hideicon,
|
||||
onNodeClick: recursiveNodeClick
|
||||
}, createSlots({ _: 2 }, [
|
||||
_ctx.$slots.title ? {
|
||||
@ -17769,7 +17774,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"])
|
||||
]), 1032, ["tree", "node-list", "show-checkbox", "show-line", "selected-key", "collapse-transition", "checkStrictly", "only-icon-control", "hideicon"])
|
||||
])) : createCommentVNode("", true)
|
||||
]),
|
||||
_: 2
|
||||
@ -17974,7 +17979,8 @@ const _sfc_main$J = defineComponent({
|
||||
children: "children",
|
||||
title: "title"
|
||||
};
|
||||
} }
|
||||
} },
|
||||
hideicon: { type: Boolean }
|
||||
},
|
||||
emits: ["update:checkedKeys", "update:expandKeys", "node-click"],
|
||||
setup(__props, { emit }) {
|
||||
@ -18036,7 +18042,8 @@ const _sfc_main$J = defineComponent({
|
||||
"check-strictly": __props.checkStrictly,
|
||||
"collapse-transition": __props.collapseTransition,
|
||||
"only-icon-control": __props.onlyIconControl,
|
||||
onNodeClick: handleClick
|
||||
onNodeClick: handleClick,
|
||||
hideicon: props.hideicon
|
||||
}, createSlots({ _: 2 }, [
|
||||
_ctx.$slots.title ? {
|
||||
name: "title",
|
||||
@ -18045,7 +18052,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"])
|
||||
]), 1032, ["tree", "node-list", "show-checkbox", "show-line", "selectedKey", "check-strictly", "collapse-transition", "only-icon-control", "hideicon"])
|
||||
], 2);
|
||||
};
|
||||
}
|
||||
|
@ -197,7 +197,7 @@ const isChildAllSelected = computed(() => {
|
||||
:collapse-transition="collapseTransition"
|
||||
:checkStrictly="checkStrictly"
|
||||
:only-icon-control="onlyIconControl"
|
||||
:hideico="props.hideicon"
|
||||
:hideicon="props.hideicon"
|
||||
@node-click="recursiveNodeClick"
|
||||
>
|
||||
<template v-if="$slots.title" v-slot:title="slotProp: { data: any }">
|
||||
|
@ -145,7 +145,7 @@ function handleClick(node: TreeData) {
|
||||
:collapse-transition="collapseTransition"
|
||||
:only-icon-control="onlyIconControl"
|
||||
@node-click="handleClick"
|
||||
:hideico="props.hideicon"
|
||||
:hideicon="props.hideicon"
|
||||
>
|
||||
<template v-if="$slots.title" v-slot:title="{ data }">
|
||||
<slot name="title" :data="data"></slot>
|
||||
|
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue
Block a user