,
};
diff --git a/src/jumper/jumper.tsx b/src/pagination/pagination-mini.tsx
similarity index 96%
rename from src/jumper/jumper.tsx
rename to src/pagination/pagination-mini.tsx
index de4d599cd..a728fbb7c 100644
--- a/src/jumper/jumper.tsx
+++ b/src/pagination/pagination-mini.tsx
@@ -8,19 +8,19 @@ import {
ChevronDownIcon as TdChevronDownIcon,
} from 'tdesign-icons-vue';
-import props from './props';
+import props from './pagination-mini-props';
import { usePrefixClass } from '../hooks/useConfig';
import { useGlobalIcon } from '../hooks/useGlobalIcon';
import TButton from '../button';
import { JumperTrigger } from './type';
export default defineComponent({
- name: 'TJumper',
+ name: 'TPaginationMini',
props: { ...props },
setup(props, { emit }) {
- const COMPONENT_NAME = usePrefixClass('jumper');
+ const COMPONENT_NAME = usePrefixClass('pagination-mini');
const {
ChevronLeftIcon, RoundIcon, ChevronRightIcon, ChevronUpIcon, ChevronDownIcon,
} = useGlobalIcon({
diff --git a/src/pagination/props.ts b/src/pagination/props.ts
index 481d93a2e..cbd2d4edd 100644
--- a/src/pagination/props.ts
+++ b/src/pagination/props.ts
@@ -11,7 +11,7 @@ export default {
/** 当前页 */
current: {
type: Number,
- default: undefined,
+ default: 1,
},
/** 当前页,非受控属性 */
defaultCurrent: {
@@ -42,7 +42,7 @@ export default {
/** 每一页的数据量 */
pageSize: {
type: Number,
- default: undefined,
+ default: 10,
},
/** 每一页的数据量,非受控属性 */
defaultPageSize: {
diff --git a/src/pagination/type.ts b/src/pagination/type.ts
index 757c7b0cd..80fd0185f 100644
--- a/src/pagination/type.ts
+++ b/src/pagination/type.ts
@@ -5,7 +5,7 @@
* */
import { SelectProps } from '../select';
-import { TNode } from '../common';
+import { TNode, SizeEnum } from '../common';
export interface TdPaginationProps {
/**
@@ -115,8 +115,49 @@ export interface TdPaginationProps {
onPageSizeChange?: (pageSize: number, pageInfo: PageInfo) => void;
}
+export interface TdPaginationMiniProps {
+ /**
+ * 按钮禁用配置
+ */
+ disabled?: boolean | JumperDisabledConfig;
+ /**
+ * 按钮方向
+ * @default horizontal
+ */
+ layout?: 'horizontal' | 'vertical';
+ /**
+ * 是否展示当前按钮
+ * @default true
+ */
+ showCurrent?: boolean;
+ /**
+ * 按钮尺寸
+ * @default medium
+ */
+ size?: SizeEnum;
+ /**
+ * 提示文案配置,值为 `true` 显示默认文案;值为 `false` 不显示提示文案;值类型为对象则单独配置文案内容
+ */
+ tips?: boolean | JumperTipsConfig;
+ /**
+ * 按钮形式
+ * @default text
+ */
+ variant?: 'text' | 'outline';
+ /**
+ * 按钮点击事件回调
+ */
+ onChange?: (context: { e: MouseEvent; trigger: JumperTrigger }) => void;
+}
+
export interface PageInfo {
current: number;
previous: number;
pageSize: number;
}
+
+export type JumperDisabledConfig = { prev?: boolean; current?: boolean; next?: boolean };
+
+export type JumperTipsConfig = { prev?: string; current?: string; next?: string };
+
+export type JumperTrigger = 'prev' | 'current' | 'next';
diff --git a/test/snap/__snapshots__/csr.test.js.snap b/test/snap/__snapshots__/csr.test.js.snap
index bc3b02852..cb5261dc9 100644
--- a/test/snap/__snapshots__/csr.test.js.snap
+++ b/test/snap/__snapshots__/csr.test.js.snap
@@ -35952,10 +35952,10 @@ exports[`csr snapshot test > csr test ./src/date-picker/_example/panel.vue 1`] =
`;
-exports[`csr snapshot test > csr test ./src/jumper/_example/layout.vue 1`] = `
-
-
-
-
-
-`;
-
-exports[`csr snapshot test > csr test ./src/jumper/_example/size.vue 1`] = `
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-`;
-
-exports[`csr snapshot test > csr test ./src/jumper/_example/tips.vue 1`] = `
-
-
-
-
-
-`;
-
exports[`csr snapshot test > csr test ./src/layout/_example/aside.vue 1`] = `
csr test ./src/pagination/_example/page-num.vue 1`]
`;
+exports[`csr snapshot test > csr test ./src/pagination/_example/pagination-mini.vue 1`] = `
+
+`;
+
exports[`csr snapshot test > csr test ./src/pagination/_example/simple.vue 1`] = `
renders ./src/date-picker/_example/first-day-of-wee
exports[`ssr snapshot test > renders ./src/date-picker/_example/month.vue correctly 1`] = `"
"`;
-exports[`ssr snapshot test > renders ./src/date-picker/_example/quarter.vue correctly 1`] = `"
一 | 二 | 三 | 四 | 五 | 六 | 日 |
---|
29 | 30 | 1 | 2 | 3 | 4 | 5 |
6 | 7 | 8 | 9 | 10 | 11 | 12 |
13 | 14 | 15 | 16 | 17 | 18 | 19 |
20 | 21 | 22 | 23 | 24 | 25 | 26 |
27 | 28 | 29 | 30 | 31 | 1 | 2 |
3 | 4 | 5 | 6 | 7 | 8 | 9 |
一 | 二 | 三 | 四 | 五 | 六 | 日 |
---|
29 | 30 | 1 | 2 | 3 | 4 | 5 |
6 | 7 | 8 | 9 | 10 | 11 | 12 |
13 | 14 | 15 | 16 | 17 | 18 | 19 |
20 | 21 | 22 | 23 | 24 | 25 | 26 |
27 | 28 | 29 | 30 | 31 | 1 | 2 |
3 | 4 | 5 | 6 | 7 | 8 | 9 |
一 | 二 | 三 | 四 | 五 | 六 | 日 |
---|
31 | 1 | 2 | 3 | 4 | 5 | 6 |
7 | 8 | 9 | 10 | 11 | 12 | 13 |
14 | 15 | 16 | 17 | 18 | 19 | 20 |
21 | 22 | 23 | 24 | 25 | 26 | 27 |
28 | 1 | 2 | 3 | 4 | 5 | 6 |
7 | 8 | 9 | 10 | 11 | 12 | 13 |
一 | 二 | 三 | 四 | 五 | 六 | 日 |
---|
28 | 1 | 2 | 3 | 4 | 5 | 6 |
7 | 8 | 9 | 10 | 11 | 12 | 13 |
14 | 15 | 16 | 17 | 18 | 19 | 20 |
21 | 22 | 23 | 24 | 25 | 26 | 27 |
28 | 29 | 30 | 31 | 1 | 2 | 3 |
4 | 5 | 6 | 7 | 8 | 9 | 10 |
一 | 二 | 三 | 四 | 五 | 六 | 日 |
---|
29 | 30 | 1 | 2 | 3 | 4 | 5 |
6 | 7 | 8 | 9 | 10 | 11 | 12 |
13 | 14 | 15 | 16 | 17 | 18 | 19 |
20 | 21 | 22 | 23 | 24 | 25 | 26 |
27 | 28 | 29 | 30 | 31 | 1 | 2 |
3 | 4 | 5 | 6 | 7 | 8 | 9 |
"`;
+exports[`ssr snapshot test > renders ./src/date-picker/_example/quarter.vue correctly 1`] = `"
一 | 二 | 三 | 四 | 五 | 六 | 日 |
---|
29 | 30 | 1 | 2 | 3 | 4 | 5 |
6 | 7 | 8 | 9 | 10 | 11 | 12 |
13 | 14 | 15 | 16 | 17 | 18 | 19 |
20 | 21 | 22 | 23 | 24 | 25 | 26 |
27 | 28 | 29 | 30 | 31 | 1 | 2 |
3 | 4 | 5 | 6 | 7 | 8 | 9 |
一 | 二 | 三 | 四 | 五 | 六 | 日 |
---|
29 | 30 | 1 | 2 | 3 | 4 | 5 |
6 | 7 | 8 | 9 | 10 | 11 | 12 |
13 | 14 | 15 | 16 | 17 | 18 | 19 |
20 | 21 | 22 | 23 | 24 | 25 | 26 |
27 | 28 | 29 | 30 | 31 | 1 | 2 |
3 | 4 | 5 | 6 | 7 | 8 | 9 |
一 | 二 | 三 | 四 | 五 | 六 | 日 |
---|
31 | 1 | 2 | 3 | 4 | 5 | 6 |
7 | 8 | 9 | 10 | 11 | 12 | 13 |
14 | 15 | 16 | 17 | 18 | 19 | 20 |
21 | 22 | 23 | 24 | 25 | 26 | 27 |
28 | 1 | 2 | 3 | 4 | 5 | 6 |
7 | 8 | 9 | 10 | 11 | 12 | 13 |
一 | 二 | 三 | 四 | 五 | 六 | 日 |
---|
28 | 1 | 2 | 3 | 4 | 5 | 6 |
7 | 8 | 9 | 10 | 11 | 12 | 13 |
14 | 15 | 16 | 17 | 18 | 19 | 20 |
21 | 22 | 23 | 24 | 25 | 26 | 27 |
28 | 29 | 30 | 31 | 1 | 2 | 3 |
4 | 5 | 6 | 7 | 8 | 9 | 10 |
一 | 二 | 三 | 四 | 五 | 六 | 日 |
---|
29 | 30 | 1 | 2 | 3 | 4 | 5 |
6 | 7 | 8 | 9 | 10 | 11 | 12 |
13 | 14 | 15 | 16 | 17 | 18 | 19 |
20 | 21 | 22 | 23 | 24 | 25 | 26 |
27 | 28 | 29 | 30 | 31 | 1 | 2 |
3 | 4 | 5 | 6 | 7 | 8 | 9 |
"`;
exports[`ssr snapshot test > renders ./src/date-picker/_example/quarter.vue correctly 2`] = `"
"`;
@@ -526,12 +526,6 @@ exports[`ssr snapshot test > renders ./src/input-number/_example/status.vue corr
exports[`ssr snapshot test > renders ./src/input-number/_example/step.vue correctly 1`] = `"
"`;
-exports[`ssr snapshot test > renders ./src/jumper/_example/layout.vue correctly 1`] = `"
"`;
-
-exports[`ssr snapshot test > renders ./src/jumper/_example/size.vue correctly 1`] = `"
"`;
-
-exports[`ssr snapshot test > renders ./src/jumper/_example/tips.vue correctly 1`] = `"
"`;
-
exports[`ssr snapshot test > renders ./src/layout/_example/aside.vue correctly 1`] = `"
"`;
exports[`ssr snapshot test > renders ./src/layout/_example/base.vue correctly 1`] = `"
"`;
@@ -685,6 +679,8 @@ exports[`ssr snapshot test > renders ./src/pagination/_example/more.vue correctl
exports[`ssr snapshot test > renders ./src/pagination/_example/page-num.vue correctly 1`] = `"
"`;
+exports[`ssr snapshot test > renders ./src/pagination/_example/pagination-mini.vue correctly 1`] = `"
"`;
+
exports[`ssr snapshot test > renders ./src/pagination/_example/simple.vue correctly 1`] = `"
"`;
exports[`ssr snapshot test > renders ./src/pagination/_example/simple-mini.vue correctly 1`] = `""`;