mirror of
https://github.com/vbenjs/vue-vben-admin.git
synced 2025-01-23 17:50:25 +08:00
fix(Table): 解决设置了分页的情况下,调整表格分页条数后,如果翻页,分页条数会重置的问题。 (#1270)
This commit is contained in:
parent
052eff91c4
commit
d6f65d476e
@ -11,6 +11,7 @@
|
|||||||
- 修复`inset`属性不起作用的问题
|
- 修复`inset`属性不起作用的问题
|
||||||
- 修复`useTable`与`BasicTable`实例的`reload`方法`await`表现不一致的问题
|
- 修复`useTable`与`BasicTable`实例的`reload`方法`await`表现不一致的问题
|
||||||
- 修复`clickToRowSelect`会无视行选择框 disabled 状态的问题
|
- 修复`clickToRowSelect`会无视行选择框 disabled 状态的问题
|
||||||
|
- 修复`BasicTable`在某些情况下,分页会被重置的问题
|
||||||
- **BasicModal**
|
- **BasicModal**
|
||||||
- 修复点击遮罩、按下`Esc`键都不能关闭`Modal`的问题
|
- 修复点击遮罩、按下`Esc`键都不能关闭`Modal`的问题
|
||||||
- 修复点击关闭按钮、最大化按钮旁边的空白区域也会导致`Modal`关闭的问题
|
- 修复点击关闭按钮、最大化按钮旁边的空白区域也会导致`Modal`关闭的问题
|
||||||
|
@ -12,7 +12,7 @@ function getRandomPics(count = 10): string[] {
|
|||||||
|
|
||||||
const demoList = (() => {
|
const demoList = (() => {
|
||||||
const result: any[] = [];
|
const result: any[] = [];
|
||||||
for (let index = 0; index < 60; index++) {
|
for (let index = 0; index < 200; index++) {
|
||||||
result.push({
|
result.push({
|
||||||
id: `${index}`,
|
id: `${index}`,
|
||||||
beginTime: '@datetime',
|
beginTime: '@datetime',
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import type { PaginationProps } from '../types/pagination';
|
import type { PaginationProps } from '../types/pagination';
|
||||||
import type { BasicTableProps } from '../types/table';
|
import type { BasicTableProps } from '../types/table';
|
||||||
import { computed, unref, ref, ComputedRef, watchEffect } from 'vue';
|
import { computed, unref, ref, ComputedRef, watch } from 'vue';
|
||||||
import { LeftOutlined, RightOutlined } from '@ant-design/icons-vue';
|
import { LeftOutlined, RightOutlined } from '@ant-design/icons-vue';
|
||||||
import { isBoolean } from '/@/utils/is';
|
import { isBoolean } from '/@/utils/is';
|
||||||
import { PAGE_SIZE, PAGE_SIZE_OPTIONS } from '../const';
|
import { PAGE_SIZE, PAGE_SIZE_OPTIONS } from '../const';
|
||||||
@ -27,15 +27,17 @@ export function usePagination(refProps: ComputedRef<BasicTableProps>) {
|
|||||||
const configRef = ref<PaginationProps>({});
|
const configRef = ref<PaginationProps>({});
|
||||||
const show = ref(true);
|
const show = ref(true);
|
||||||
|
|
||||||
watchEffect(() => {
|
watch(
|
||||||
const { pagination } = unref(refProps);
|
() => unref(refProps).pagination,
|
||||||
if (!isBoolean(pagination) && pagination) {
|
(pagination) => {
|
||||||
configRef.value = {
|
if (!isBoolean(pagination) && pagination) {
|
||||||
...unref(configRef),
|
configRef.value = {
|
||||||
...(pagination ?? {}),
|
...unref(configRef),
|
||||||
};
|
...(pagination ?? {}),
|
||||||
}
|
};
|
||||||
});
|
}
|
||||||
|
},
|
||||||
|
);
|
||||||
|
|
||||||
const getPaginationInfo = computed((): PaginationProps | boolean => {
|
const getPaginationInfo = computed((): PaginationProps | boolean => {
|
||||||
const { pagination } = unref(refProps);
|
const { pagination } = unref(refProps);
|
||||||
|
@ -22,6 +22,7 @@
|
|||||||
title: '远程加载示例',
|
title: '远程加载示例',
|
||||||
api: demoListApi,
|
api: demoListApi,
|
||||||
columns: getBasicColumns(),
|
columns: getBasicColumns(),
|
||||||
|
pagination: { pageSize: 10 },
|
||||||
});
|
});
|
||||||
function handleReloadCurrent() {
|
function handleReloadCurrent() {
|
||||||
reload();
|
reload();
|
||||||
|
Loading…
Reference in New Issue
Block a user