-
Notifications
You must be signed in to change notification settings - Fork 7.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bug: 当Page组件里面是Grid时,Page的footer slot内容会覆盖掉表格部分内容 #5494
Labels
bug
Something isn't working
Comments
贴出你的问题代码,不要让别人为了复现你的问题去重新组织代码 |
Hello @im-here. Please provide the complete reproduction steps and code. Issues labeled by |
<script lang="ts" setup>
import type { VxeGridListeners, VxeGridProps } from '#/adapter/vxe-table';
import { Page } from '@vben/common-ui';
import { ElButton, ElMessage } from 'element-plus';
import { useVbenVxeGrid } from '#/adapter/vxe-table';
import { MOCK_TABLE_DATA } from './table-data';
interface RowType {
address: string;
age: number;
id: number;
name: string;
nickname: string;
role: string;
}
const gridOptions: VxeGridProps<RowType> = {
rowConfig: {
isHover: true,
},
stripe: true,
columns: [
{ title: '序号', type: 'seq', width: 50 },
{ field: 'name', title: 'Name' },
{ field: 'age', sortable: true, title: 'Age' },
{ field: 'nickname', title: 'Nickname' },
{ field: 'role', title: 'Role' },
{ field: 'address', showOverflow: false, title: 'Address' },
{
field: 'action',
fixed: 'right',
slots: { default: 'action' },
title: '操作',
width: 120,
},
],
data: MOCK_TABLE_DATA,
pagerConfig: {
enabled: false,
},
sortConfig: {
multiple: true,
},
};
const gridEvents: VxeGridListeners<RowType> = {
cellClick: ({ row }) => {
ElMessage.info(`cell-click: ${row.name}`);
},
};
const [Grid, gridApi] = useVbenVxeGrid({ gridEvents, gridOptions });
const showBorder = gridApi.useStore((state) => state.gridOptions?.border);
const showStripe = gridApi.useStore((state) => state.gridOptions?.stripe);
function changeBorder() {
gridApi.setGridOptions({
border: !showBorder.value,
});
}
function changeStripe() {
gridApi.setGridOptions({
stripe: !showStripe.value,
});
}
function changeLoading() {
gridApi.setLoading(true);
setTimeout(() => {
gridApi.setLoading(false);
}, 2000);
}
</script>
<template>
<Page>
<template #footer>footer content</template>
<Grid>
<template #toolbar-tools>
<ElButton class="mr-2" type="primary" @click="changeBorder">
{{ showBorder ? '隐藏' : '显示' }}边框
</ElButton>
<ElButton class="mr-2" type="primary" @click="changeLoading">
显示loading
</ElButton>
<ElButton class="mr-2" type="primary" @click="changeStripe">
{{ showStripe ? '隐藏' : '显示' }}斑马纹
</ElButton>
</template>
<template #action>编辑</template>
</Grid>
</Page>
</template>
和示例里的 |
Page组件有两个地方需要修改
2、自适应计算高度包含footer高度
|
1 task
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Version
Vben Admin V5
Describe the bug?
Reproduction
/
System Info
Relevant log output
Validations
The text was updated successfully, but these errors were encountered: