hookehuyr

style(PaginationField): 重构分页组件布局使用网格系统

将actions容器从flex布局改为grid布局,实现左中右三列对齐
左列(上一页)靠左,中列(提交)居中,右列(下一页)靠右
1 <!-- 1 <!--
2 * @Date: 2025-11-18 16:17:40 2 * @Date: 2025-11-18 16:17:40
3 * @LastEditors: hookehuyr hookehuyr@gmail.com 3 * @LastEditors: hookehuyr hookehuyr@gmail.com
4 - * @LastEditTime: 2025-11-20 17:56:14 4 + * @LastEditTime: 2025-11-25 14:48:19
5 * @FilePath: /data-table/src/components/PaginationField/index.vue 5 * @FilePath: /data-table/src/components/PaginationField/index.vue
6 * @Description: 分页组件 6 * @Description: 分页组件
7 --> 7 -->
...@@ -9,6 +9,7 @@ ...@@ -9,6 +9,7 @@
9 <div class="pagination-field"> 9 <div class="pagination-field">
10 <div class="indicator">第{{ current + 1 }}页 / 共{{ total }}页</div> 10 <div class="indicator">第{{ current + 1 }}页 / 共{{ total }}页</div>
11 <div class="actions"> 11 <div class="actions">
12 + <div class="actionsLeft">
12 <van-button 13 <van-button
13 v-if="showPrev" 14 v-if="showPrev"
14 :disabled="prev_disabled_effective || current === 0" 15 :disabled="prev_disabled_effective || current === 0"
...@@ -17,9 +18,14 @@ ...@@ -17,9 +18,14 @@
17 class="btn" 18 class="btn"
18 @click="onPrev" 19 @click="onPrev"
19 >{{ prev_label_effective }}</van-button> 20 >{{ prev_label_effective }}</van-button>
20 - <van-button v-if="showNext" round type="primary" class="btn" @click="onNext">{{ nextLabel }}</van-button> 21 + </div>
22 + <div class="actionsCenter">
21 <van-button v-if="showSubmit" round type="primary" class="btn" @click="onSubmit">{{ submitButton.text }}</van-button> 23 <van-button v-if="showSubmit" round type="primary" class="btn" @click="onSubmit">{{ submitButton.text }}</van-button>
22 </div> 24 </div>
25 + <div class="actionsRight">
26 + <van-button v-if="showNext" round type="primary" class="btn" @click="onNext">{{ nextLabel }}</van-button>
27 + </div>
28 + </div>
23 </div> 29 </div>
24 </template> 30 </template>
25 31
...@@ -94,8 +100,24 @@ const onSubmit = () => emit('submit') ...@@ -94,8 +100,24 @@ const onSubmit = () => emit('submit')
94 } 100 }
95 101
96 .actions { 102 .actions {
97 - display: flex; 103 + // 三列栅格:左列起始(上一页),中列居中(提交),右列末尾(下一页)
98 - gap: 0.75rem; 104 + display: grid;
105 + width: 100%;
106 + grid-template-columns: 1fr auto 1fr;
107 + align-items: start; // 垂直方向顶对齐
108 + min-height: 44px; // 保障容器高度,按钮靠顶部
109 +
110 + .actionsLeft {
111 + justify-self: start; // 左对齐到边
112 + }
113 +
114 + .actionsCenter {
115 + justify-self: center; // 中间居中
116 + }
117 +
118 + .actionsRight {
119 + justify-self: end; // 右对齐到边
120 + }
99 121
100 .btn { 122 .btn {
101 min-width: 6rem; 123 min-width: 6rem;
......