Toggle navigation
Toggle navigation
This project
Loading...
Sign in
Hooke
/
data-table
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Graphs
Network
Create a new issue
Commits
Issue Boards
Authored by
hookehuyr
2025-11-20 15:44:49 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
414682834bae8e71805a6886fa3b2cfe38359291
41468283
1 parent
cf4b718b
feat(分页组件): 添加可配置的提交按钮文本
允许通过 submit-label 属性自定义分页组件中提交按钮的文本
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
3 deletions
src/components/PaginationField/index.vue
src/views/index.vue
src/components/PaginationField/index.vue
View file @
4146828
<!--
* @Date: 2025-11-18 16:17:40
* @LastEditors: hookehuyr hookehuyr@gmail.com
* @LastEditTime: 2025-11-
18 16:48:02
* @LastEditTime: 2025-11-
20 15:44:14
* @FilePath: /data-table/src/components/PaginationField/index.vue
* @Description: 分页组件
-->
...
...
@@ -11,7 +11,7 @@
<div class="actions">
<van-button v-if="showPrev" :disabled="prevDisabled || current === 0" round type="primary" class="btn" @click="onPrev">{{ prevLabel }}</van-button>
<van-button v-if="showNext" round type="primary" class="btn" @click="onNext">{{ nextLabel }}</van-button>
<van-button v-if="showSubmit" round type="primary" class="btn" @click="onSubmit">
提交
</van-button>
<van-button v-if="showSubmit" round type="primary" class="btn" @click="onSubmit">
{{ submitLabel }}
</van-button>
</div>
</div>
<div class="placeholder" />
...
...
@@ -26,6 +26,7 @@ const props = defineProps({
isLast: { type: Boolean, default: false },
prevLabel: { type: String, default: '上一页' },
nextLabel: { type: String, default: '下一页' },
submitLabel: { type: String, default: '提交' },
prevDisabled: { type: Boolean, default: false },
})
...
...
src/views/index.vue
View file @
4146828
<!--
* @Date: 2022-07-18 10:22:22
* @LastEditors: hookehuyr hookehuyr@gmail.com
* @LastEditTime: 2025-11-
19 18:04:59
* @LastEditTime: 2025-11-
20 15:44:03
* @FilePath: /data-table/src/views/index.vue
* @Description: 首页
-->
...
...
@@ -35,6 +35,7 @@
:is-last="current_page_index === filtered_pages.length - 1"
:prev-label="page_nav.prev_text"
:next-label="page_nav.next_text"
:submit-label="PCommit.text ? PCommit.text : '提交'"
:prev-disabled="page_nav.prev_disabled"
@prev="handlePrev"
@next="handleNext"
...
...
Please
register
or
login
to post a comment