quasar ui组件的使用记录

1、关于自定义页码 quasar pagination

  • 根据客户需求定制页码选项
    在这里插入图片描述
//table组件的相关属性
:rows-per-page-options = [10,50,500]
//完整代码
//html
 <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> 

//对应js片段代码
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 {
          }
        });
    },
    
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值