From 9e081ff71921d15b7feac153bb012937a4020b9c Mon Sep 17 00:00:00 2001 From: Uyarn Date: Wed, 4 Dec 2024 16:49:21 +0800 Subject: [PATCH 1/3] fix: complete class and style --- src/pagination/usePaginationClasses.ts | 1 + src/table/hooks/usePagination.tsx | 2 ++ 2 files changed, 3 insertions(+) diff --git a/src/pagination/usePaginationClasses.ts b/src/pagination/usePaginationClasses.ts index 59ae56cd4f..8936373628 100644 --- a/src/pagination/usePaginationClasses.ts +++ b/src/pagination/usePaginationClasses.ts @@ -23,6 +23,7 @@ export default function usePaginationClasses( [STATUS.value.disabled]: props.disabled, [`${name.value}-ie`]: getIEVersion() < 11, }, + props.theme === 'simple' ? `${name.value}--simple` : ``, ]); const totalClass = computed(() => [`${name.value}__total`]); diff --git a/src/table/hooks/usePagination.tsx b/src/table/hooks/usePagination.tsx index 97727c96e7..a6dfdeddcf 100644 --- a/src/table/hooks/usePagination.tsx +++ b/src/table/hooks/usePagination.tsx @@ -2,6 +2,7 @@ import { ref, SetupContext, toRefs, watch } from 'vue'; import { useConfig } from '../../hooks/useConfig'; import Pagination, { PageInfo, PaginationProps } from '../../pagination'; import { TdBaseTableProps, TableRowData } from '../type'; +import { SizeEnum } from '../../common'; // 分页功能包含:远程数据排序受控、远程数据排序非受控、本地数据排序受控、本地数据排序非受控 等 4 类功能 export default function usePagination(props: TdBaseTableProps, context: SetupContext) { @@ -62,6 +63,7 @@ export default function usePagination(props: TdBaseTableProps, context: SetupCon return (
{ props.pagination?.onChange?.(pageInfo); From ebc4e625a22a9080a01633f04acdd256881565eb Mon Sep 17 00:00:00 2001 From: Uyarn Date: Tue, 10 Dec 2024 22:13:35 +0800 Subject: [PATCH 2/3] chore: update snapshot --- test/unit/snap/__snapshots__/csr.test.js.snap | 6 +++--- test/unit/snap/__snapshots__/ssr.test.js.snap | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/test/unit/snap/__snapshots__/csr.test.js.snap b/test/unit/snap/__snapshots__/csr.test.js.snap index 47b44c06f8..9299dcaffb 100644 --- a/test/unit/snap/__snapshots__/csr.test.js.snap +++ b/test/unit/snap/__snapshots__/csr.test.js.snap @@ -98525,7 +98525,7 @@ exports[`csr snapshot test > csr test ./src/pagination/_example/pagination-mini. exports[`csr snapshot test > csr test ./src/pagination/_example/simple.vue 1`] = `
csr test ./src/pagination/_example/simple.vue 1`] = exports[`csr snapshot test > csr test ./src/pagination/_example/simple-mini.vue 1`] = `
csr test ./src/transfer/_example/pagination.vue 1`] class="t-transfer__list-pagination" >
diff --git a/test/unit/snap/__snapshots__/ssr.test.js.snap b/test/unit/snap/__snapshots__/ssr.test.js.snap index 72b2c24255..07e8f861f3 100644 --- a/test/unit/snap/__snapshots__/ssr.test.js.snap +++ b/test/unit/snap/__snapshots__/ssr.test.js.snap @@ -782,9 +782,9 @@ exports[`ssr snapshot test > ssr test ./src/pagination/_example/page-num.vue 1`] exports[`ssr snapshot test > ssr test ./src/pagination/_example/pagination-mini.vue 1`] = `"
layout:
size:
"`; -exports[`ssr snapshot test > ssr test ./src/pagination/_example/simple.vue 1`] = `"
共 100 条数据
5 条/页
跳至
/ 20 页
"`; +exports[`ssr snapshot test > ssr test ./src/pagination/_example/simple.vue 1`] = `"
共 100 条数据
5 条/页
跳至
/ 20 页
"`; -exports[`ssr snapshot test > ssr test ./src/pagination/_example/simple-mini.vue 1`] = `"
共 100 条数据
5 条/页
跳至
/ 20 页
"`; +exports[`ssr snapshot test > ssr test ./src/pagination/_example/simple-mini.vue 1`] = `"
共 100 条数据
5 条/页
跳至
/ 20 页
"`; exports[`ssr snapshot test > ssr test ./src/pagination/_example/total.vue 1`] = `"
共 685 项数据
10 条/页
  • 1
  • 10
  • 11
  • 12
  • 13
  • 14
  • 69
"`; @@ -1352,7 +1352,7 @@ exports[`ssr snapshot test > ssr test ./src/transfer/_example/disabled.vue 1`] = exports[`ssr snapshot test > ssr test ./src/transfer/_example/empty.vue 1`] = `"

默认暂无数据

0 / 0 项
暂无数据
0 / 0 项
暂无数据

自定义空状态

0 / 0 项
No Data
0 / 0 项
No Data
"`; -exports[`ssr snapshot test > ssr test ./src/transfer/_example/pagination.vue 1`] = `"
0 / 20 项
跳至
/ 2 页
0 / 0 项
暂无数据
"`; +exports[`ssr snapshot test > ssr test ./src/transfer/_example/pagination.vue 1`] = `"
0 / 20 项
跳至
/ 2 页
0 / 0 项
暂无数据
"`; exports[`ssr snapshot test > ssr test ./src/transfer/_example/search.vue 1`] = `""`; From e74de4bcee60aff91cd8ed1cd394db3f5ac06c06 Mon Sep 17 00:00:00 2001 From: PengYYY Date: Tue, 10 Dec 2024 22:18:39 +0800 Subject: [PATCH 3/3] fix: lint fix --- src/table/hooks/usePagination.tsx | 1 - 1 file changed, 1 deletion(-) diff --git a/src/table/hooks/usePagination.tsx b/src/table/hooks/usePagination.tsx index a6dfdeddcf..9a5eddea35 100644 --- a/src/table/hooks/usePagination.tsx +++ b/src/table/hooks/usePagination.tsx @@ -2,7 +2,6 @@ import { ref, SetupContext, toRefs, watch } from 'vue'; import { useConfig } from '../../hooks/useConfig'; import Pagination, { PageInfo, PaginationProps } from '../../pagination'; import { TdBaseTableProps, TableRowData } from '../type'; -import { SizeEnum } from '../../common'; // 分页功能包含:远程数据排序受控、远程数据排序非受控、本地数据排序受控、本地数据排序非受控 等 4 类功能 export default function usePagination(props: TdBaseTableProps, context: SetupContext) {