From 2bb7a827789e4c5bc84ee965050cd6cb43781d59 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BB=B2=E4=B9=88=E4=BA=86?= Date: Wed, 3 Jan 2024 14:23:49 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/table/defaultAttribute.ts | 1 + src/utils/tableStore.ts | 6 +++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/components/table/defaultAttribute.ts b/src/components/table/defaultAttribute.ts index 28040bc..7a7490f 100644 --- a/src/components/table/defaultAttribute.ts +++ b/src/components/table/defaultAttribute.ts @@ -9,5 +9,6 @@ export const defaultAttribute:VxeTableProps = { columnConfig: { resizable: true }, rowConfig: { isCurrent: true, isHover: true }, scrollX: { scrollToLeftOnChange: true }, + scrollY: { scrollToTopOnChange: true,enabled:true }, treeConfig: {} } \ No newline at end of file diff --git a/src/utils/tableStore.ts b/src/utils/tableStore.ts index 6c6ce0e..b8b4855 100644 --- a/src/utils/tableStore.ts +++ b/src/utils/tableStore.ts @@ -48,6 +48,7 @@ export default class TableStore { } index() { + this.table.data = [] this.table.loading = true // 重置用的数据数据 if (!this.initData) { @@ -124,7 +125,10 @@ export default class TableStore { () => { this.table.params.pageNum = data.page if (this.isWebPaging) { - this.table.data = this.table.webPagingData[data.page - 1] + this.table.data = [] + requestAnimationFrame(() => { + this.table.data = this.table.webPagingData[data.page - 1] + }) } else { this.index() }