在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. beego——view 模板语法

    一.基本语法 go统一使用{{和}}作为左右标签,没有其它的标签符号. 使用"."来访问当前位置的上下文,使用"$"来引用当前模板根级的上下文,使用$var来访 ...

  2. Keras 回归 拟合 收集

    案例1 from keras.models import Sequential from keras.layers import Dense, LSTM, Activation from keras. ...

  3. bootstrap之表格自适应 table-responsive

    <div class=table-responsive"> <table class="table"> <thead> <tr& ...

  4. Java修饰符类型

    转自原文:http://www.yiibai.com/java/java_modifier_types.html 修饰符是添加到这些定义来改变它们的含义的关键词. Java语言有各种各样修饰词,其中包 ...

  5. mysql的优化总结

    1,允许数据库适当冗余提高查询效率 2,对于索引的使用要适当

  6. day04_1hibernate

    log4j的整合.一对一关系的操作.二级缓存的介绍 一.log4j的整合: 1.介绍什么是 slf4j 核心jar  : slf4j-api-1.6.1.jar .slf4j是日志框架,将其他优秀的日 ...

  7. 2020算法设计竞赛 C 汉诺塔

    作者:珩月链接:https://ac.nowcoder.com/discuss/367149来源:牛客网 将木板按照Xi从小到大排序,将这时的Yi数列记为Zi数列,则问题变成将Zi划分为尽可能少的若干 ...

  8. wcf接口输出为json格式

    接口定义: [OperationContract] [WebInvoke(UriTemplate = "AddTask?taskId={taskId}&processGuid={pr ...

  9. jQuery实现TAB选项卡切换特效简单演示

    本文实例为大家分享jQuery实现TAB选项卡切换特效,供大家参考,具体内容如下 1.tab切换 on ? 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 1 ...

  10. goahead web 服务器

    https://blog.csdn.net/xieyihua1994/article/details/74002413