mirror of
https://github.com/pure-admin/vue-pure-admin.git
synced 2025-11-15 14:03:36 +08:00
fix: 修复在菜单、部门管理中,表格展开后启用或关闭全屏功能时,表格高度未自动适应的问题
This commit is contained in:
@@ -26,6 +26,11 @@ const {
|
||||
handleDelete,
|
||||
handleSelectionChange
|
||||
} = useDept();
|
||||
|
||||
function onFullscreen() {
|
||||
// 重置表格高度
|
||||
tableRef.value.setAdaptive();
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
@@ -75,6 +80,7 @@ const {
|
||||
:columns="columns"
|
||||
:tableRef="tableRef?.getTableRef()"
|
||||
@refresh="onSearch"
|
||||
@fullscreen="onFullscreen"
|
||||
>
|
||||
<template #buttons>
|
||||
<el-button
|
||||
|
||||
@@ -27,6 +27,11 @@ const {
|
||||
handleDelete,
|
||||
handleSelectionChange
|
||||
} = useMenu();
|
||||
|
||||
function onFullscreen() {
|
||||
// 重置表格高度
|
||||
tableRef.value.setAdaptive();
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
@@ -66,6 +71,7 @@ const {
|
||||
:isExpandAll="false"
|
||||
:tableRef="tableRef?.getTableRef()"
|
||||
@refresh="onSearch"
|
||||
@fullscreen="onFullscreen"
|
||||
>
|
||||
<template #buttons>
|
||||
<el-button
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { tableData } from "../data";
|
||||
import { ref, onMounted } from "vue";
|
||||
import { clone, delay } from "@pureadmin/utils";
|
||||
import { clone } from "@pureadmin/utils";
|
||||
|
||||
export function useColumns() {
|
||||
const dataList = ref([]);
|
||||
@@ -38,14 +38,8 @@ export function useColumns() {
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
delay(600).then(() => {
|
||||
const newList = [];
|
||||
Array.from({ length: 6 }).forEach(() => {
|
||||
newList.push(clone(tableData, true));
|
||||
});
|
||||
newList.flat(Infinity).forEach((item, index) => {
|
||||
dataList.value.push({ id: index, ...item });
|
||||
});
|
||||
clone(tableData, true).forEach((item, index) => {
|
||||
dataList.value.push({ id: index, ...item });
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user