在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. LED Holiday Light -holiday Light Inspection Implementation Recommendations

    China LED Holiday Light Factory & Ninghai County Haohua Electronic Appliance Co., Ltd. pointed o ...

  2. Jenkins +Ant +Jmeter(apache-jmeter-5.1.1)自动化性能测试平台

    1.安装配置好Jdk, 下载网址:https://www.cr173.com/soft/33894.html 2.Jmeter下载地址:http://jmeter.apache.org/downloa ...

  3. 一步步教你如何在ubuntu虚拟机中安装QEMU并模拟arm 开发环境(二)rootfs制作

    过了,一天,周又到了,博主终于可以拿出时间来把上一次没有给大家展示完了的内容今天在这里一并展示给大家,希望和大家共同进步,共同学习,同时我也虔诚的希望各位业界的朋友把自己的工作经验拿出来大家一起分享, ...

  4. Pandownload---windows下几乎无敌的网盘下载神器

    近几天光顾着mac了,今天咱来聊聊Windows. 这个就不多说了,直接贴图. 网页版截图. 电脑版截图. 网页版2020.2.1的时候是失效的,别问我为什么不现在测试,用不着. 不用担心不知道密码, ...

  5. C语言 栈的初始化,入栈,出栈,判断栈是否为空,清空栈等函数

    #include <stdio.h>#include <stdlib.h> typedef struct Node{ int data ; struct Node * pNex ...

  6. Mybatis之连接池

    一,前言 ​ 连接池有很多种,最为熟悉的比如c3p0,DBCP,druid等. ​ mybatis支持三种内置的数据源类型: Pooled:实现dataSource接口,并且使用了池的思想. UNPo ...

  7. JS高级---沙箱小案例

    沙箱小案例 substr截取, 从指定的字段开始截取 (function () { var str="小白喜欢小黑"; str=str.substr(2); console.log ...

  8. date-fns时间库的基本使用

    在react中使用date-fns: import sub_days from 'date-fns/sub_days'; import start_of_week from 'date-fns/sta ...

  9. OpenTLD相关资料

    这是一位来自奥地利的博士生的博客 他的介绍如下: I am a PhD student at the Safety and Security Department of the Austrian In ...

  10. Django中content-type组件的使用

    content-type组件 ContentType是Django的内置的一个应用,可以追踪项目的所有APP和model的对应关系,并记录在ContentTpe表中,当我们的项目做数据迁移后,会有很多 ...