fix: tree bugs

This commit is contained in:
xingyu4j
2025-10-09 18:23:35 +08:00
parent f63dc0ecef
commit d2f50c9388
7 changed files with 60 additions and 58 deletions

View File

@@ -135,16 +135,15 @@ function getAllNodeIds(nodes: any[], ids: number[] = []): number[] {
<Form class="mx-4">
<template #dataScopeDeptIds="slotProps">
<Tree
v-loading="deptLoading"
:tree-data="deptTree"
multiple
bordered
:spinning="deptLoading"
:expanded="expandedKeys"
:default-expanded-keys="expandedKeys"
v-bind="slotProps"
:check-strictly="!isCheckStrictly"
value-field="id"
label-field="name"
:auto-check-parent="false"
:check-strictly="!isCheckStrictly"
/>
</template>
</Form>

View File

@@ -143,11 +143,11 @@ function getNodeClass(node: Recordable<any>) {
<Form class="mx-4">
<template #menuIds="slotProps">
<Tree
:spinning="menuLoading"
v-loading="menuLoading"
:tree-data="menuTree"
multiple
bordered
:expanded="expandedKeys"
:default-expanded-keys="expandedKeys"
:get-node-class="getNodeClass"
v-bind="slotProps"
value-field="id"

View File

@@ -135,12 +135,12 @@ function getAllNodeIds(nodes: any[], ids: number[] = []): number[] {
<Form class="mx-6">
<template #menuIds="slotProps">
<Tree
v-loading="menuLoading"
class="max-h-96 overflow-y-auto"
:loading="menuLoading"
:tree-data="menuTree"
multiple
bordered
:expanded="expandedKeys"
:default-expanded-keys="expandedKeys"
v-bind="slotProps"
value-field="id"
label-field="name"