This commit is contained in:
神仙都没用 2023-11-24 15:22:29 +08:00
parent 0f440cae4c
commit 561b6a670d
2 changed files with 5 additions and 2 deletions

View File

@ -36,9 +36,10 @@
:props="tree.props"
:load="tree.onLoad"
:default-expanded-keys="tree.defaultExpandedKeys"
@node-click="select"
>
<template #default="{ data }">
<div class="item" @click="select(data)">
<div class="item">
<component :is="data.icon" v-if="data.icon" />
<span>{{ data[tree.props.label] }}</span>
</div>
@ -508,6 +509,7 @@ defineExpose({
display: flex;
align-items: center;
line-height: 1;
height: 100%;
width: 100%;
}
}

View File

@ -33,6 +33,7 @@
v-loading="loading"
node-key="id"
default-expand-all
highlight-current
:data="list"
:props="{
label: 'name'
@ -42,6 +43,7 @@
:allow-drop="allowDrop"
:expand-on-click-node="false"
@node-contextmenu="onContextMenu"
@node-click="rowClick"
>
<template #default="{ node, data }">
<div class="dept-tree__node">
@ -50,7 +52,6 @@
:class="{
'is-active': data.id == ViewGroup?.selected?.id
}"
@click="rowClick(data)"
>{{ node.label }}</span
>
<span