zoukankan      html  css  js  c++  java
  • elemengui分页

    <!-- 分页模块 -->
        <template>
          <div class="block" style="margin-top:20px">
            <el-pagination
              @size-change="handleSizeChange"
              @current-change="handleCurrentChange"
              :current-page="current"
              :page-sizes="[10, 20, 30]"
              :page-size="pageSize"
              layout="total, sizes, prev, pager, next, jumper"
              :total="total">
            </el-pagination>
          </div>
        </template>
      handleSizeChange(pageSize) {
           this.pageSize = pageSize 
           this.getAccountOrders()
          },
          handleCurrentChange(current) {
            this.current = current ;
            this.getAccountOrders()
          },
          // 获取用户订单信息
          getAccountOrders(){
            this.accountId = this.$route.query.id
            let params = '?current='+this.current+'&page_size='+this.pageSize
            this.$http.get(baseUrl+'/order/'+this.accountId + params)
            .then(res =>{
              if(res.data.code == 200 ){
                  let data = res.data.data ;
                  this.tableDatas = data.pages.records ;
                  this.current = data.pages.current ;
                  this.pageSize = data.pages.size ;
                  this.total = data.pages.total ;
    
                  if(this.current == 1 ){
                      this.accountForm = data.account ;
                  }
              }
            })
            .catch((e) => {
              console.log(e)
            })
    
          },
  • 相关阅读:
    [转]MyBatis传入多个参数的问题
    【转】赶集网mysql开发36军规
    C#套接字和windowsAPI套接字
    java中的注解
    java中的枚举类型
    过去的汇编代码
    近日错误集锦
    java swing模仿随机频谱
    java泛型中的对象
    XML-RPC远程方法调用
  • 原文地址:https://www.cnblogs.com/pretttyboy/p/14029267.html
Copyright © 2011-2022 走看看