vue-element分页
<template>
<card-layout :title="L('Users')" :actions="actions" @click="handleClick">
<el-table :data="tableData4.slice((currentPage-1)*pagesize,currentPage*pagesize)" :default-sort="{prop: 'date', order: 'descending'}" style="width: 100%">
<el-table-column fixed prop="id" label="编号" width="">
</el-table-column>
<el-table-column prop="name" label="姓名" width="">
</el-table-column>
<el-table-column prop="password" type="password" label="密码" width="">
</el-table-column>
<el-table-column prop="sexType" label="性别" width="" :formatter="sexTypes">
</el-table-column>
<el-table-column prop="phone" label="电话" width="">
</el-table-column>
<el-table-column prop="email" label="邮箱" width="">
</el-table-column>
<el-table-column prop="birthday" label="生日" width="">
</el-table-column>
<el-table-column prop="integral" label="等级" width="" :formatter="Getlevel">
</el-table-column>
<el-table-column fixed="right" label="操作" width=""> <template slot-scope="scope">
<el-button type="danger" @click.native.prevent="deleteRow(scope.row, tableData4)" size="small">
移除
</el-button>
<el-button type="primary" @click="EditClick(scope.row)" size="small">
{{Edit}}
</el-button>
</template> </el-table-column>
</el-table>
<el-pagination @size-change="handleSizeChange" @current-change="handleCurrentChange" :current-page="currentPage" :page-sizes="[5, 10, 20, 40]" :page-size="pagesize" layout="total, sizes, prev, pager, next, jumper" :total="tableData4.length">
</el-pagination> <update :show.sync="shows" @renovate="getuser" :datas="mydata" ></update>
<UserEdit :show.sync="show" @renovate="getuser"></UserEdit> </card-layout>
</template> <script>
import datatablepaging from "../.././components/basicElement/dataTable/dataTablePaging.vue";
import UserEdit from "./UserEdit-dialog.vue";
import update from './Update.vue'
export default {
methods: {
deleteRow(index, rows) {
rows.splice(index, );
}
},
data() {
return {
Edit:"编辑",
pagesize: , //每页的数据条数
currentPage: , //默认开始页面
show: false,
shows:false,
mydata:{},
SkipCount: ,
MaxResultCount: ,
actions: [
[
{
id: "New",
type: "primary",
text: "New",
icon: "fa fa-plus"
},
{
id: "Refresh",
type: "success",
text: "Refresh",
icon: "fa fa-refresh"
}
]
],
tableData4: []
};
},
components: {
UserEdit,
datatablepaging,
update
},
methods: {
open() {
this.show = true;
},
opens(){
this.shows = true;
},
created: function() {
this.total = this.tableData4.length;
},
current_change: function(currentPage) {
this.currentPage = currentPage;
},
handleClick(id) {
switch (id) {
case "New":
this.AddUser();
break;
case "Refresh":
this.Refresh();
break;
default:
break;
}
},
AddUser() {
this.open();
},
Refresh() {
this.getuser();
},
getuser() {
this.$http
.get(
"/api/services/app/Userinfro/GetUserinofor?MaxResultCount=" +
this.MaxResultCount
)
.then(result => {
this.tableData4 = result.data.result.items;
//console.log(result.data.result.items);
})
.catch(err => {
console.log(err);
});
},
sexTypes(row, column) {
if (row.sexType == ) {
return "男";
} else {
return "女";
}
},
Getlevel(row, column) {
if (row.integral >= && row.integral < ) {
return "白银";
}
if (row.integral >= && row.integral < ) {
return "黄金";
}
if (row.integral >= && row.integral < ) {
return "铂金";
}
if (row.integral >= ) {
return "钻石";
}
},
deleteRow(row) {
this.$confirm("此操作将永久删除该用户, 是否继续?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
}).then(() => {
this.$http
.delete("/api/services/app/Userinfro/DeleteUserByid?Id=" + row.id)
.then(result => {
this.$message({
type: "success",
message: "删除成功!"
});
this.getuser();
})
.catch(err => {
console.log(err);
});
});
},
EditClick(data) {
this.opens();
//console.log(data)
this.mydata=data;
},
handleSizeChange(size){
this.pagesize=size;
},
handleCurrentChange(currentPage)
{
this.currentPage=currentPage;
}
},
created() {
this.getuser();
}
};
</script>
<style>
.el-pagination { padding-top: 12px;
}
</style>

vue-element分页的更多相关文章
- Vue element 分页
Vue单页面,有一个带分页的表格,表格内数据关联页码,套路如下: 代码如下: <div class="c-table-list auth-list m-bottom-20"& ...
- 循序渐进VUE+Element 前端应用开发(30)--- ABP后端和Vue+Element前端结合的分页排序处理
在很多列表展示数据的场合中,大多数都会需要一个排序的处理,以方便快速查找排序所需的数据,本篇随笔介绍如何结合ABP后端和Vue+Element前端结合的分页排序处理过程. 1.Vue+Element前 ...
- vue+element实现分页--之--前端分页
效果图: 访问的数据量小,一次返回所有数据,再次利用elementUI-Table 和el-pagination组件进行展示,关键点事数据的筛选 官网的完整案例 <div class=" ...
- vue + element ui 实现实现动态渲染表格
前言:之前需要做一个页面,能够通过表名动态渲染出不同的表格,这里记录一下.转载请注明出处:https://www.cnblogs.com/yuxiaole/p/9786326.html 网站地址:我的 ...
- Vue 实现分页+输入框关键字筛选
分页的实现(Vue+Element)+输入框关键字筛选 1.这里用的是Element 自带的分页组件 <template> <div class="sales-table& ...
- 新书上线:《Spring Boot+Spring Cloud+Vue+Element项目实战:手把手教你开发权限管理系统》,欢迎大家买回去垫椅子垫桌脚
新书上线 大家好,笔者的新书<Spring Boot+Spring Cloud+Vue+Element项目实战:手把手教你开发权限管理系统>已上线,此书内容充实.材质优良,乃家中必备垫桌脚 ...
- Vue+element ui table 导出到excel
需求: Vue+element UI table下的根据搜索条件导出当前所有数据 参考: https://blog.csdn.net/u010427666/article/details/792081 ...
- 循序渐进VUE+Element 前端应用开发(4)--- 获取后端数据及产品信息页面的处理
在前面随笔<循序渐进VUE+Element 前端应用开发(3)--- 动态菜单和路由的关联处理>中介绍了在Vue + Element整合框架中,实现了动态菜单和动态路由的处理,从而可以根据 ...
- 循序渐进VUE+Element 前端应用开发(5)--- 表格列表页面的查询,列表展示和字段转义处理
在我们一般开发的系统界面里面,列表页面是一个非常重要的综合展示界面,包括有条件查询.列表展示和分页处理,以及对每项列表内容可能进行的转义处理,本篇随笔介绍基于Vue +Element基础上实现表格列表 ...
- 循序渐进VUE+Element 前端应用开发(6)--- 常规Element 界面组件的使用
在我们开发BS页面的时候,往往需要了解常规界面组件的使用,小到最普通的单文本输入框.多文本框.下拉列表,以及按钮.图片展示.弹出对话框.表单处理.条码二维码等等,本篇随笔基于普通表格业务的展示录入的场 ...
随机推荐
- ActiveMQ JMS 项目 基于 Maven 搭建 部署
JAVA版本: IntellJ IDEA 版本: IntelliJ IDEA 2017.2Build #IU-172.3317.76, built on July 15, 2017Licensed t ...
- LostRoutes项目日志——编辑project.json
第一个Scene编译后运行会报错: Uncaught TypeError: Cannot read property 'style' of null 这是因为没有在project.json中包含已经编 ...
- 使用Python3.7.0搭建简易服务器
一.下载并安装Python 官网地址 二.新建start_server.bat 在需要搭建服务器的根目录位置,新建一个start_server.bat文件 内容 python -m http.serv ...
- spark on yarn 无法提交任务问题
java.lang.NoClassDefFoundError: com/sun/jersey/api/client/config/ClientConfig spark任务提交出错. 原因: spark ...
- 网络通信协议之ICMP
ICMP(互联网控制消息协议) ICMP >>Internet Control Message Protocol IP协议的缺点: >>无差错报告和差错纠正机制 >> ...
- python面向对象-三大特性
python面向对象编程三大特性 小结:前面我们说完了类和对象的关系,相信对类和对象的理解更加透彻..让我们一起去研究面向对象的三大特性吧.... 继承 1.什么继承? 在程序中继承就是事物之间的所属 ...
- 错误:22 http://ppa.launchpad.net/fkrull/deadsnakes/ubuntu bionic Release 404 Not Found [IP: 91.189.95.83 80]
https://blog.csdn.net/chenbetter1996/article/details/80255552 到仓库地址找到哦该文件 删除两个文件就可以了
- io 流操作hdfs
hdfs 文件上传 本地 --------> 文件系统对象 --------> hdfs 文件系统 输入流 ...
- POJ 3974 - Palindrome - [字符串hash+二分]
题目链接:http://poj.org/problem?id=3974 Time Limit: 15000MS Memory Limit: 65536K Description Andy the sm ...
- [No0000D2]ClearCSharp编程清理脚本批处理bat
for /f "tokens=*" %%a in ('dir obj /b /ad /s ^|sort') do rd "%%a" /s/q for /f &q ...