From 364ac46a44dcac7775af98c0d50c3d676c7cef58 Mon Sep 17 00:00:00 2001 From: HQ-Lin Date: Mon, 8 Aug 2022 15:38:26 +0800 Subject: [PATCH 1/2] =?UTF-8?q?feat:=20=E8=B0=83=E6=95=B4=20pagination=20?= =?UTF-8?q?=E6=A0=B7=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/_common | 2 +- src/pagination/pagination.tsx | 52 ++--- .../components/transfer-operations.tsx | 4 +- test/ssr/__snapshots__/ssr.test.js.snap | 112 ++++++---- .../__snapshots__/demo.test.js.snap | 31 ++- .../__snapshots__/demo.test.js.snap | 206 +++++++++--------- .../table/__snapshots__/demo.test.js.snap | 64 ++++-- .../transfer/__snapshots__/demo.test.js.snap | 59 ++--- 8 files changed, 277 insertions(+), 253 deletions(-) diff --git a/src/_common b/src/_common index d2d878e8c..3ae5c9544 160000 --- a/src/_common +++ b/src/_common @@ -1 +1 @@ -Subproject commit d2d878e8cb64cb110f383a6177d3af99f372811b +Subproject commit 3ae5c954430ad8b703c671d438e43b0f45f2fb27 diff --git a/src/pagination/pagination.tsx b/src/pagination/pagination.tsx index 453f48da6..59a0f292e 100644 --- a/src/pagination/pagination.tsx +++ b/src/pagination/pagination.tsx @@ -13,6 +13,7 @@ import mixins from '../utils/mixins'; import getConfigReceiverMixins, { PaginationConfig } from '../config-provider/config-receiver'; import TInputNumber from '../input-number'; import { Select, Option } from '../select'; +import InputAdornment from '../input-adornment'; import CLASSNAMES from '../utils/classnames'; import { renderTNodeJSX } from '../utils/render-tnode'; import props from './props'; @@ -304,6 +305,25 @@ export default mixins(getConfigReceiverMixins('pagination }, render() { + const Jumper = ( +
+ {this.t(this.global.jumpTo)} + + + +
+ ); + return (
{/* 数据统计区 */} @@ -380,17 +400,7 @@ export default mixins(getConfigReceiverMixins('pagination ) : null} {/* 极简版 */} - {this.showPageNumber && this.theme === 'simple' ? ( - - ) : null} + {this.theme === 'simple' && Jumper} {/* 向后按钮 */} {this.showPreviousAndNextBtn ? (
('pagination
) : null} - {/* 跳转 */} - {this.showJumper ? ( -
- {this.t(this.global.jumpTo)} - - {this.t(this.global.page)} -
- ) : null} + {/* 快速跳转 */} + {this.theme === 'default' && this.showJumper && Jumper}
); }, diff --git a/src/transfer/components/transfer-operations.tsx b/src/transfer/components/transfer-operations.tsx index 6000e41a1..33d13d23c 100644 --- a/src/transfer/components/transfer-operations.tsx +++ b/src/transfer/components/transfer-operations.tsx @@ -79,7 +79,7 @@ export default Vue.extend({ return (
-
jump to
-
-
-
+
jump to
+
+
+
+
+
/ 4
@@ -10645,11 +10647,14 @@ exports[`ssr snapshot test renders ./examples/pagination/demos/customizable.vue
-
跳至
-
-
-
-
+
跳至
+
+
+
+
+
/ 10 页 +
+
`; @@ -10682,11 +10687,14 @@ exports[`ssr snapshot test renders ./examples/pagination/demos/disabled.vue corr
-
跳至
-
-
-
-
+
跳至
+
+
+
+
+
/ 20 页 +
+
`; @@ -10744,11 +10752,14 @@ exports[`ssr snapshot test renders ./examples/pagination/demos/jump.vue correctl
-
跳至
-
-
-
-
+
跳至
+
+
+
+
+
/ 6 页 +
+
`; @@ -10890,11 +10901,12 @@ exports[`ssr snapshot test renders ./examples/pagination/demos/simple.vue correc
-
-
-
-
1/20 -
+
跳至
+
+
+
+
+
/ 20 页
@@ -10917,11 +10929,12 @@ exports[`ssr snapshot test renders ./examples/pagination/demos/simple-mini.vue c
-
-
-
-
1/20 -
+
跳至
+
+
+
+
+
/ 20 页
@@ -17275,11 +17288,14 @@ exports[`ssr snapshot test renders ./examples/table/demos/pagination.vue correct
-
跳至
-
-
-
-
+
跳至
+
+
+
+
+
/ 12 页 +
+
@@ -17347,11 +17363,14 @@ exports[`ssr snapshot test renders ./examples/table/demos/pagination-ajax.vue co
-
跳至
-
-
-
-
+
跳至
+
+
+
+
+
/ 1 页 +
+
@@ -19099,7 +19118,7 @@ exports[`ssr snapshot test renders ./examples/transfer/demos/base.vue correctly -
-
@@ -619,26 +627,34 @@ exports[`Pagination Pagination disabledVue demo works fine 1`] = ` > 跳至
- +
+ +
+ + / 20 页 +
- 页 @@ -899,26 +915,34 @@ exports[`Pagination Pagination jumpVue demo works fine 1`] = ` > 跳至
- +
+ +
+ + / 6 页 +
- 页 @@ -1590,50 +1614,37 @@ exports[`Pagination Pagination simpleMiniVue demo works fine 1`] = `
+ 跳至
- - - 1/20 - - - - - - +
+
+ + / 20 页 +
+ 跳至
- - - 1/20 - - - - - - +
+
+ + / 20 页 +
跳至
- +
+ +
+ + / 1 页 +
- 页
@@ -18075,26 +18083,34 @@ exports[`Table Table paginationVue demo works fine 1`] = ` > 跳至
- +
+ +
+ + / 12 页 +
- 页 diff --git a/test/unit/transfer/__snapshots__/demo.test.js.snap b/test/unit/transfer/__snapshots__/demo.test.js.snap index 59c9c019a..d4fb06bde 100644 --- a/test/unit/transfer/__snapshots__/demo.test.js.snap +++ b/test/unit/transfer/__snapshots__/demo.test.js.snap @@ -459,7 +459,7 @@ exports[`Transfer Transfer baseVue demo works fine 1`] = ` class="t-transfer__operations" >