【发布时间】:2021-04-01 07:00:49
【问题描述】:
当列表中没有项目或只有一页时,我想禁用按钮
<v-model="currentPage"
:length="lastPage"
total-visible="10"
prev-icon="mdi-menu-left"
next-icon="mdi-menu-right"
@input="handlePageChange"
class="elevation-0"
>
</v-pagination>
JS
getCountries() {
axios
.get("api/countries/get?page=${this.currentPage}`)
.then(response => {
this.loading = false;
this.tableLoading = false;
this.countries = response.data.data;
this.currentPage = response.data.current_page;
this.lastPage = response.data.last_page;
});
},
【问题讨论】:
-
您可能会检查总金额以及 lastPage 并使用一些 CSS 隐藏分页。在
v-pagination组件上看起来像这样的:class="[elementsNoneOrOnePageOnly ? 'hidding-class' : '']"。
标签: vue.js vuetify.js disable paginator