UPDATE: 优化高度

This commit is contained in:
贾同学
2025-09-05 09:09:18 +08:00
parent 6122f53c8e
commit 6d6d03c03c
2 changed files with 9 additions and 6 deletions

View File

@@ -46,7 +46,7 @@
</div> </div>
</el-col> </el-col>
</el-row> </el-row>
<el-scrollbar ref="leftScrollbarRef" :height="props.height" style="margin-top: 20px"> <el-scrollbar ref="leftScrollbarRef" :height="leftHeight" style="margin-top: 20px">
<el-tree <el-tree
ref="leftTreeRef" ref="leftTreeRef"
show-checkbox show-checkbox
@@ -121,7 +121,7 @@
</el-scrollbar> </el-scrollbar>
<!-- 传递 footer 插槽到 el-card --> <!-- 传递 footer 插槽到 el-card -->
<template #footer> <template #footer v-if="!props.disabled">
<slot name="footer"></slot> <slot name="footer"></slot>
</template> </template>
</el-card> </el-card>
@@ -319,11 +319,14 @@ onMounted(() => {
initTree(props.data) initTree(props.data)
} }
}) })
const rightHeight = computed(() => { const leftHeight = computed(() => {
if (!props.disabled) { if (!props.disabled) {
return props.height + 45.2 return props.height
} }
return props.height return props.height + 45.2
})
const rightHeight = computed(() => {
return props.height + 45.2
}) })
watch( watch(
() => props.data, () => props.data,

View File

@@ -188,7 +188,7 @@
:titles="['被检设备列表', '已选被检设备列表']" :titles="['被检设备列表', '已选被检设备列表']"
filter-placeholder="请输入内容搜索" filter-placeholder="请输入内容搜索"
:data="devData" :data="devData"
:height="230" :height="220"
:disabled="allDisabled" :disabled="allDisabled"
> >
<template v-if="planType === 0 && !allDisabled" #footer> <template v-if="planType === 0 && !allDisabled" #footer>