1、关于自定义页码 quasar pagination
- 根据客户需求定制页码选项
:rows-per-page-options = [10,50,500]
<q-table
class="q-mr-sm q-ml-sm q-mt-md"
title="开机时长"
separator='cell'
:data="data"
:columns="columns"
rows-per-page-label="每页数据"
color="primary"
:rows-per-page-options = [10,50,500]
:pagination.sync="Msgpagination"
@request="tableRequestMsg"
row-key="id"
>
<template v-slot:body="props">
<q-tr :props="props">
<q-td key="zcbh" :props="props">{{ props.row.zcbh }}</q-td>
<q-td key="pl_name" :props="props">{{ props.row.pl_name }}</q-td>
<q-td key="ip" :props="props">{{ props.row.ip }}</q-td>
</q-tr>
</template>
</q-table>
page: 1,
limit: 10,
columns:[],
Msgpagination: {
page: 1,
rowsPerPage: 10,
rowsNumber: 0,
},
tableRequestMsg(pv) {
var pageinfo = pv.pagination;
this.page = pageinfo.page;
this.Msgpagination.rowsPerPage = pageinfo.rowsPerPage;
this.Msgpagination.page = pageinfo.page;
this.limit = pageinfo.rowsPerPage;
this.getPoliceMsg();
},
getPoliceMsg() {
let self = this;
this.$axios
.post(CONFIG.httphost() + "/MessageShowController/showClientTime", {
st: this.page,
limit: this.limit,
})
.then((resp) => {
let res = resp.data;
let code = res.code;
console.log(res,'showClientTime')
if (!code) {
this.data = res.data;
var sum = res.sum;
self.Msgpagination.rowsNumber = sum;
} else {
}
});
},