fix: when a table switches paging, no form parameters will be carried (#4607)

* fix: when a table switches paging, no form parameters will be carried

* chore: typo
This commit is contained in:
Vben
2024-10-10 22:48:25 +08:00
committed by GitHub
parent f923f59070
commit 304b1b2efc
9 changed files with 67 additions and 43 deletions

View File

@@ -29,6 +29,9 @@ const gridOptions: VxeGridProps<RowType> = {
{ field: 'address', showOverflow: true, title: 'Address' },
],
data: MOCK_TABLE_DATA,
pagerConfig: {
enabled: false,
},
sortConfig: {
multiple: true,
},

View File

@@ -30,12 +30,6 @@ const gridOptions: VxeGridProps<RowType> = {
title: 'DateTime',
width: 500,
},
{
field: 'releaseDate',
formatter: 'formatDate',
title: 'Date',
width: 300,
},
{
field: 'action',
fixed: 'right',

View File

@@ -3,7 +3,7 @@ import type { VbenFormProps, VxeGridProps } from '#/adapter';
import { Page } from '@vben/common-ui';
import { Button, message } from 'ant-design-vue';
import { message } from 'ant-design-vue';
import { useVbenVxeGrid } from '#/adapter';
import { getExampleTableApi } from '#/api';
@@ -60,6 +60,8 @@ const formOptions: VbenFormProps = {
label: 'Date',
},
],
// 控制表单是否显示折叠按钮
showCollapseButton: true,
};
const gridOptions: VxeGridProps<RowType> = {
@@ -93,26 +95,11 @@ const gridOptions: VxeGridProps<RowType> = {
},
};
const [Grid, gridApi] = useVbenVxeGrid({ formOptions, gridOptions });
function toggleFormCollspae() {
gridApi.formApi.setState((prev) => {
return {
...prev,
showCollapseButton: !prev.showCollapseButton,
};
});
}
const [Grid] = useVbenVxeGrid({ formOptions, gridOptions });
</script>
<template>
<Page auto-content-height>
<Grid>
<template #toolbar-tools>
<Button type="primary" @click="toggleFormCollspae">
切换表单折叠按钮
</Button>
</template>
</Grid>
<Grid />
</Page>
</template>