在template

<template>
<div class="Terminal" v-loading="loading">
<!-- 查询操作 -->
<div class="select">
<el-form :label-position="'left'">
<el-form-item label="所属门店:">
<el-select v-model="merchantNo" placeholder="请选择" class="city-select">
<el-option label="全部" value="" />
<el-option v-for="item in provinceOption" :key="item.key" :label="item.merchantShortName" :value="item.merchantNo" />
</el-select>
</el-form-item>
<el-form-item label="终端编号:">
<el-input v-model="posDeviceId" />
</el-form-item>
<el-button @click="Search">查询</el-button>
</el-form>
</div>
<!-- 表格 -->
<div class="store-table">
<el-table :data="tableData" style="width: 100%" header-row-class-name="table-title">
<el-table-column label="终端编号">
<template slot-scope="scope">
{{ scope.row.posDeviceId }}
</template>
</el-table-column>
<el-table-column label="品牌型号">
<template slot-scope="scope">
{{ scope.row.brand }}
<!-- <span v-if="scope.row.brand == '01'">百福</span>
<span v-if="scope.row.brand == '06'">惠尔丰</span> -->
</template>
</el-table-column>
<el-table-column label="所属门店">
<template slot-scope="scope">
{{ scope.row.merchantName }}
</template>
</el-table-column>
<el-table-column label="门店类型">
<template slot-scope="scope">
<span v-if="scope.row.merchantType == '1'">普通商户</span>
<span v-if="scope.row.merchantType == '2'">连锁总店</span>
<span v-if="scope.row.merchantType == '3'">连锁分店独立营业执照</span>
<span v-if="scope.row.merchantType == '4'">连锁分店无营业执照</span>
</template>
</el-table-column>
</el-table>
<!-- 分页 -->
<div class="pagination">
<el-pagination background layout="prev, pager, next, jumper, sizes" :current-page="startPage" :prev-text="prev" :next-text="next" :page-sizes="pagesizearrray" :page-size="pageSize" :total="totalNum" @size-change="handleSizeChange" @current-change="handleCurrentChange" />
</div>

</div>
</div>
</template>

在script

export default {
data() {
return {
startPage: ,
// 每页的数据
pageSize: ,
pagesizearrray: [, , , ],
totalNum: ,
tableData: [],
prev: this.$t('personal.prev'), // 上一页
next: this.$t('personal.next'), // 下一页
}
},
}

在methods

 methods: {
// 初始页currentPage、初始每页数据数pagesize和数据data
handleSizeChange(size) {
this.pageSize = size
this.handleUserList()
},
handleCurrentChange(startPage) {
this.startPage = startPage
this.handleUserList()
},
handleUserList() {
  // 这个是接口的调用
getpos({
posDeviceId: '',
merchantNo: '',
startPage: this.startPage,
pageSize: this.pageSize,
innerMain: ,
}).then((res) => {
// console.log(res, '表格数据')
if (res.code === '') {
this.loading = false
if (res.data) {
this.tableData = res.data.list
      //分页处理  
this.totalNum = res.data.totalCount
this.totalCount = res.data.totalCount
} else {
this.tableData = []
this.totalCount =
}
}
})
},

最后在moutend或created中进行调用数据

this.handleUserList()
 
 
注意这是element中的分页 里面的数据和接口和调换成你自己的。要不然会报错的

element中的分页的更多相关文章

  1. tp中使用分页技术

    1 public function showList() { $m_ld = D ( 'guangxi_ld' ); $page = I ( 'get.p', 1 ); // 在配置中获取分页值 $p ...

  2. Oracle中经典分页代码!

    在Oracle中因为没有top关键字,所以在sqlserver中的分页代码并不适用于Oracle,那么在Oracle中如何来实现分页呢? --查询所有数据 STUNO STUNAME STUAGE S ...

  3. 在yii中使用分页

    yii中使用分页很方便,如下两种方法: 在控制器中: 1. $criteria = new CDbCriteria(); //new cdbcriteria数据库$criteria->id = ...

  4. [数据库]Oracle和mysql中的分页总结

    Mysql中的分页 物理分页 •在sql查询时,从数据库只检索分页需要的数据 •通常不同的数据库有着不同的物理分页语句 •mysql物理分页,采用limit关键字 •例如:检索11-20条 selec ...

  5. LigerUi中的Grid中不分页显示(local)!

    LigerUi中的Grid中不分页显示! grid为local usePager: true,                         //是否分页

  6. ExtJS学习--------Ext.Element中的经常使用事件和其它重要的方法学习(实例)

    经常使用事件: 其它重要方法: 详细实例:(实例结果能够将相应的代码取消凝视进行測试) Ext.onReady(function(){ Ext.create('Ext.panel.Panel',{ t ...

  7. mongo中的分页查询

    /** * @param $uid * @param $app_id * @param $start_time * @param $end_time * @param $start_page * @p ...

  8. springboot中使用分页,文件上传,jquery的具体步骤(持续更新)

    分页: pom.xml     加依赖 <dependency> <groupId>com.github.pagehelper</groupId> <arti ...

  9. restful中的分页

    普通分页 普通分页类似于Django中的分页 源码 class PageNumberPagination(BasePagination): """ A simple pa ...

随机推荐

  1. Laravel中使用QRcode自制二维码

    一.配置 1.在项目根目录输入命令 composer require simplesoftwareio/simple-qrcode 1.3.* 2.在config/app.php 的 provider ...

  2. 51Nod 1449 砝码称重 (二进制思想)

    现在有好多种砝码,他们的重量是 w0,w1,w2,...  每种各一个.问用这些砝码能不能表示一个重量为m的东西. 样例解释:可以将重物和3放到一个托盘中,9和1放到另外一个托盘中. Input 单组 ...

  3. thinkphp5出现mkdir() Permission denied报错解决办法

    如果没有runtime目录,则需要手动创建一个,并且给runtime添加权限: mkdir runtime chmod -R 777 runtime 报错如下:

  4. SmartSVN:File has inconsistent newlines

    用SmartSVN提交文件的时候,提示svn: File has inconsistent newlines 这是由于要提交的文件编码时混合了windows和unix符号导致的. 解决方案 Smart ...

  5. bootstrap-datatimepicker插件的使用

    1.引入相关的css.js文件(因为是bootstrap的,首先应该引入bootstrap.css和bootstrap.js): <link rel="stylesheet" ...

  6. django学习,captcha图形验证码的使用

    很多网站在登录或者注册的时候都有验证码,让你去输入. 刚好有这么一款插件,可以满足这个功能 首先,先pip install  django-simple-captcha 然后再setting里添加,如 ...

  7. mybatis-plus - MybatisPlusAutoConfiguration

    mybatis 的通用maper, 其实有很多, mybatis-plus 算是其中做的比较好的一款了. 这里就来看一下 mybatis-plus 是怎么实现这个通用mapper功能的. 一. Bas ...

  8. Introduction to SQL

    目录 SELECTING SELECTing single columns SELECTing multiple columns select all SELECT DISTINCT Learning ...

  9. 题解【BZOJ4472】[JSOI2015]salesman

    题面 树形\(\text{DP}\)与贪心的结合. 首先考虑树形\(\text{DP}\). 设\(dp_i\)表示从\(i\)出发,访问\(i\)的子树,并且最后回到\(i\)能获得的最大收益. 转 ...

  10. Postgresql 教程

    Official 教程 关闭postgresql服务 PostgreSQL帐号 1. PostgreSQL 用户帐号和操作系统用户帐号是不同的,系统用户帐号是postgres. sudo -u pos ...