You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Vuetify data table隐藏items-per-page后翻页按钮左移如何调整到右侧

Vuetify DataTable 隐藏每页条数选择后调整分页控件位置方案

你当前的配置隐藏每页条数控件后分页左移,是因为原页脚采用左右分栏的flex布局,左侧元素隐藏后剩余元素默认左对齐,按以下方法调整即可:


方案1:使用Vuetify内置工具类(无额外自定义CSS,推荐)

直接在现有footer-props中添加class配置,调用框架自带的flex右对齐工具类:

:footer-props="{
  'items-per-page-options': [10],
  'disable-items-per-page': true,
  class: 'justify-end'
}"
  • 适配Vuetify 2.x 和 3.x 所有支持footer-props的版本
  • 完全不影响翻页控件的原有交互逻辑

方案2:自定义CSS覆盖(适配特殊场景)

如果需要更精细的样式控制,可以给DataTable组件加自定义类名后覆盖页脚样式:

  1. 给v-data-table添加自定义类
<v-data-table
  class="hide-items-per-page-table"
  :footer-props="{
    'items-per-page-options': [10],
    'disable-items-per-page': true
  }"
  ...其他属性
/>
  1. 添加样式
/* Vuetify 2.x 版本 */
.hide-items-per-page-table .v-data-footer {
  justify-content: flex-end;
}

/* Vuetify 3.x 版本 */
.hide-items-per-page-table .v-data-table-footer {
  justify-content: flex-end;
}

内容的提问来源于stack exchange,提问作者Milano

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.09.25 23:45:09