add tree hideicon

This commit is contained in:
Theluyuan 2023-04-25 09:16:07 +08:00
parent 392b2d1547
commit e293b80814
2 changed files with 7 additions and 0 deletions

View File

@ -35,6 +35,7 @@ export interface TreeNodeProps {
checkStrictly: boolean | string;
collapseTransition: boolean;
onlyIconControl: boolean;
hideicon?: boolean;
}
interface TreeNodeEmits {
@ -69,6 +70,9 @@ const nodeIconType = (node: TreeData): string => {
if (node.children.length !== 0) {
return !node.isLeaf ? "layui-icon-addition" : "layui-icon-subtraction";
}
if(props.hideicon){
return ""
}
return "layui-icon-file";
};
@ -193,6 +197,7 @@ const isChildAllSelected = computed(() => {
:collapse-transition="collapseTransition"
:checkStrictly="checkStrictly"
:only-icon-control="onlyIconControl"
:hideico="props.hideicon"
@node-click="recursiveNodeClick"
>
<template v-if="$slots.title" v-slot:title="slotProp: { data: any }">

View File

@ -38,6 +38,7 @@ export interface TreeProps {
showLine?: boolean;
showCheckbox?: boolean;
replaceFields?: ReplaceFieldsOptions;
hideicon?:boolean;
}
interface TreeEmits {
@ -144,6 +145,7 @@ function handleClick(node: TreeData) {
:collapse-transition="collapseTransition"
:only-icon-control="onlyIconControl"
@node-click="handleClick"
:hideico="props.hideicon"
>
<template v-if="$slots.title" v-slot:title="{ data }">
<slot name="title" :data="data"></slot>