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)
            })
    
          },
  • 相关阅读:
    Python基础
    XML文件的基础使用
    正则表达式的基本使用
    hafs的java_api(转载)
    HDFS常用的Shell命令(转载)
    安装hadoop2.4.1
    配置JDK环境变量
    准备Linux环境
    Winform窗体屏蔽Alt+F4强制关闭
    leetcode 0214
  • 原文地址:https://www.cnblogs.com/pretttyboy/p/14029267.html
Copyright © 2011-2022 走看看