hookehuyr

feat(分页组件): 添加可配置的提交按钮文本

允许通过 submit-label 属性自定义分页组件中提交按钮的文本
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-18 16:48:02 4 + * @LastEditTime: 2025-11-20 15:44:14
5 * @FilePath: /data-table/src/components/PaginationField/index.vue 5 * @FilePath: /data-table/src/components/PaginationField/index.vue
6 * @Description: 分页组件 6 * @Description: 分页组件
7 --> 7 -->
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
11 <div class="actions"> 11 <div class="actions">
12 <van-button v-if="showPrev" :disabled="prevDisabled || current === 0" round type="primary" class="btn" @click="onPrev">{{ prevLabel }}</van-button> 12 <van-button v-if="showPrev" :disabled="prevDisabled || current === 0" round type="primary" class="btn" @click="onPrev">{{ prevLabel }}</van-button>
13 <van-button v-if="showNext" round type="primary" class="btn" @click="onNext">{{ nextLabel }}</van-button> 13 <van-button v-if="showNext" round type="primary" class="btn" @click="onNext">{{ nextLabel }}</van-button>
14 - <van-button v-if="showSubmit" round type="primary" class="btn" @click="onSubmit">提交</van-button> 14 + <van-button v-if="showSubmit" round type="primary" class="btn" @click="onSubmit">{{ submitLabel }}</van-button>
15 </div> 15 </div>
16 </div> 16 </div>
17 <div class="placeholder" /> 17 <div class="placeholder" />
...@@ -26,6 +26,7 @@ const props = defineProps({ ...@@ -26,6 +26,7 @@ const props = defineProps({
26 isLast: { type: Boolean, default: false }, 26 isLast: { type: Boolean, default: false },
27 prevLabel: { type: String, default: '上一页' }, 27 prevLabel: { type: String, default: '上一页' },
28 nextLabel: { type: String, default: '下一页' }, 28 nextLabel: { type: String, default: '下一页' },
29 + submitLabel: { type: String, default: '提交' },
29 prevDisabled: { type: Boolean, default: false }, 30 prevDisabled: { type: Boolean, default: false },
30 }) 31 })
31 32
......
1 <!-- 1 <!--
2 * @Date: 2022-07-18 10:22:22 2 * @Date: 2022-07-18 10:22:22
3 * @LastEditors: hookehuyr hookehuyr@gmail.com 3 * @LastEditors: hookehuyr hookehuyr@gmail.com
4 - * @LastEditTime: 2025-11-19 18:04:59 4 + * @LastEditTime: 2025-11-20 15:44:03
5 * @FilePath: /data-table/src/views/index.vue 5 * @FilePath: /data-table/src/views/index.vue
6 * @Description: 首页 6 * @Description: 首页
7 --> 7 -->
...@@ -35,6 +35,7 @@ ...@@ -35,6 +35,7 @@
35 :is-last="current_page_index === filtered_pages.length - 1" 35 :is-last="current_page_index === filtered_pages.length - 1"
36 :prev-label="page_nav.prev_text" 36 :prev-label="page_nav.prev_text"
37 :next-label="page_nav.next_text" 37 :next-label="page_nav.next_text"
38 + :submit-label="PCommit.text ? PCommit.text : '提交'"
38 :prev-disabled="page_nav.prev_disabled" 39 :prev-disabled="page_nav.prev_disabled"
39 @prev="handlePrev" 40 @prev="handlePrev"
40 @next="handleNext" 41 @next="handleNext"
......