const PurchaseRecords = {
template: `
<div class="demo">
<div class="content" style="height:auto;">
<div class="purchaserecords">
<p>购买记录</p>
</div>
<div class="info">
<input class="daochu"@click="" type="button" value="导出所有参与用户"/>
<div class="title" style="margin-left: 24px;margin-top: 32px;">
<div class="container_table">
<el-table :data="lists.slice((currentPage-1)*pagesize,currentPage*pagesize)" stripe style="width: 100%;border:none;" :default-sort="{prop: 'date', order: 'descending'}">
<el-table-column prop="userImg" label="用户头像"></el-table-column>
<el-table-column prop="lusername" label="昵称"></el-table-column>
<el-table-column prop="realname" label="真实姓名"></el-table-column>
<el-table-column prop="telnum" label="手机号"></el-table-column>
<el-table-column prop="conum" label="订单号"></el-table-column>
<el-table-column prop="hongb" sortable label="收到红包总金额"></el-table-column>
<el-table-column prop="bmtime" sortable label="报名时间"></el-table-column>
<el-table-column prop="downtime" sortable label="下单时间"></el-table-column>
<el-table-column label="操作">
<template slot-scope="scope">
<el-button type="danger" v-if="istag" @click=''>删除</el-button>
<!-- <el-button type="primary" icon="el-icon-star-on" v-if="istag" @click='switchChange'></el-button>
<el-button type="primary" icon="el-icon-star-off" v-else="!istag" @click='switchChange'></el-button>-->
</template>
</el-table-column>
</el-table>
<!--分页显示的数字-->
<el-pagination class="fy" layout="prev, pager, next,total" @current-change="current_change" :total=total></el-pagination>
</div>
</div>
</div>
</div>
</div>`,
data() {
return {
total:1000,//默认数据总数
pagesize:10,//每页的数据条数
currentPage:1,//默认开始页面
istag: true,
input:"",
input21: '',
lists: [
{
"userImg": "img",
"lusername": "南柯残梦",
"realname": "流SIR",
"telnum": "18626131234",
"conum": "2019042112120304586",
"hongb": "22",
"bmtime": "2019-04-21 12:12:12",
"downtime": "2019-04-21 12:12:12"
},
{
"userImg": "img",
"lusername": "南柯残梦",
"realname": "流SIR",
"telnum": "18626131234",
"conum": "2019042112120304586",
"hongb": "22",
"bmtime": "2019-04-21 12:12:12",
"downtime": "2019-04-21 12:12:12"
},
{
"userImg": "img",
"lusername": "南柯残梦",
"realname": "流SIR",
"telnum": "18626131234",
"conum": "2019042112120304586",
"hongb": "22",
"bmtime": "2019-04-21 12:12:12",
"downtime": "2019-04-21 12:12:12"
},
{
"userImg": "img",
"lusername": "南柯残梦",
"realname": "流SIR",
"telnum": "18626131234",
"conum": "2019042112120304586",
"hongb": "22",
"bmtime": "2019-04-21 12:12:12",
"downtime": "2019-04-21 12:12:12"
},
{
"userImg": "img",
"lusername": "南柯残梦",
"realname": "流SIR",
"telnum": "18626131234",
"conum": "2019042112120304586",
"hongb": "22",
"bmtime": "2019-04-21 12:12:12",
"downtime": "2019-04-21 12:12:12"
},
{
"userImg": "img",
"lusername": "南柯残梦",
"realname": "流SIR",
"telnum": "18626131234",
"conum": "2019042112120304586",
"hongb": "22",
"bmtime": "2019-04-21 12:12:12",
"downtime": "2019-04-21 12:12:12"
},
{
"userImg": "img",
"lusername": "南柯残梦",
"realname": "流SIR",
"telnum": "18626131234",
"conum": "2019042112120304586",
"hongb": "22",
"bmtime": "2019-04-21 12:12:12",
"downtime": "2019-04-21 12:12:12"
},
{
"userImg": "img",
"lusername": "南柯残梦",
"realname": "流SIR",
"telnum": "18626131234",
"conum": "2019042112120304586",
"hongb": "22",
"bmtime": "2019-04-21 12:12:12",
"downtime": "2019-04-21 12:12:12"
},
{
"userImg": "img",
"lusername": "南柯残梦",
"realname": "流SIR",
"telnum": "18626131234",
"conum": "2019042112120304586",
"hongb": "22",
"bmtime": "2019-04-21 12:12:12",
"downtime": "2019-04-21 12:12:12"
},
{
"userImg": "img",
"lusername": "南柯残梦",
"realname": "流SIR",
"telnum": "18626131234",
"conum": "2019042112120304586",
"hongb": "22",
"bmtime": "2019-04-21 12:12:12",
"downtime": "2019-04-21 12:12:12"
},
{
"userImg": "img",
"lusername": "南柯残梦",
"realname": "流SIR",
"telnum": "18626131234",
"conum": "2019042112120304586",
"hongb": "22",
"bmtime": "2019-04-21 12:12:12",
"downtime": "2019-04-21 12:12:12"
},
{
"userImg": "img",
"lusername": "南柯残梦",
"realname": "流SIR",
"telnum": "18626131234",
"conum": "2019042112120304586",
"hongb": "22",
"bmtime": "2019-04-21 12:12:12",
"downtime": "2019-04-21 12:12:12"
},
{
"userImg": "img",
"lusername": "南柯残梦",
"realname": "流SIR",
"telnum": "18626131234",
"conum": "2019042112120304586",
"hongb": "22",
"bmtime": "2019-04-21 12:12:12",
"downtime": "2019-04-21 12:12:12"
},
{
"userImg": "img",
"lusername": "南柯残梦",
"realname": "流SIR",
"telnum": "18626131234",
"conum": "2019042112120304586",
"hongb": "22",
"bmtime": "2019-04-21 12:12:12",
"downtime": "2019-04-21 12:12:12"
},
{
"userImg": "img",
"lusername": "南柯残梦",
"realname": "流SIR",
"telnum": "18626131234",
"conum": "2019042112120304586",
"hongb": "22",
"bmtime": "2019-04-21 12:12:12",
"downtime": "2019-04-21 12:12:12"
},
{
"userImg": "img",
"lusername": "南柯残梦",
"realname": "流SIR",
"telnum": "18626131234",
"conum": "2019042112120304586",
"hongb": "22",
"bmtime": "2019-04-21 12:12:12",
"downtime": "2019-04-21 12:12:12"
},
{
"userImg": "img",
"lusername": "南柯残梦",
"realname": "流SIR",
"telnum": "18626131234",
"conum": "2019042112120304586",
"hongb": "22",
"bmtime": "2019-04-21 12:12:12",
"downtime": "2019-04-21 12:12:12"
},
{
"userImg": "img",
"lusername": "南柯残梦",
"realname": "流SIR",
"telnum": "18626131234",
"conum": "2019042112120304586",
"hongb": "22",
"bmtime": "2019-04-21 12:12:12",
"downtime": "2019-04-21 12:12:12"
},
{
"userImg": "img",
"lusername": "南柯残梦",
"realname": "流SIR",
"telnum": "18626131234",
"conum": "2019042112120304586",
"hongb": "22",
"bmtime": "2019-04-21 12:12:12",
"downtime": "2019-04-21 12:12:12"
},
{
"userImg": "img",
"lusername": "南柯残梦",
"realname": "流SIR",
"telnum": "18626131234",
"conum": "2019042112120304586",
"hongb": "22",
"bmtime": "2019-04-21 12:12:12",
"downtime": "2019-04-21 12:12:12"
},
{
"userImg": "img",
"lusername": "南柯残梦",
"realname": "流SIR",
"telnum": "18626131234",
"conum": "2019042112120304586",
"hongb": "22",
"bmtime": "2019-04-21 12:12:12",
"downtime": "2019-04-21 12:12:12"
},
{
"userImg": "img",
"lusername": "南柯残梦",
"realname": "流SIR",
"telnum": "18626131234",
"conum": "2019042112120304586",
"hongb": "22",
"bmtime": "2019-04-21 12:12:12",
"downtime": "2019-04-21 12:12:12"
},
{
"userImg": "img",
"lusername": "南柯残梦",
"realname": "流SIR",
"telnum": "18626131234",
"conum": "2019042112120304586",
"hongb": "22",
"bmtime": "2019-04-21 12:12:12",
"downtime": "2019-04-21 12:12:12"
},
{
"userImg": "img",
"lusername": "南柯残梦",
"realname": "流SIR",
"telnum": "18626131234",
"conum": "2019042112120304586",
"hongb": "22",
"bmtime": "2019-04-21 12:12:12",
"downtime": "2019-04-21 12:12:12"
},
{
"userImg": "img",
"lusername": "南柯残梦",
"realname": "流SIR",
"telnum": "18626131234",
"conum": "2019042112120304586",
"hongb": "22",
"bmtime": "2019-04-21 12:12:12",
"downtime": "2019-04-21 12:12:12"
},
{
"userImg": "img",
"lusername": "南柯残梦",
"realname": "流SIR",
"telnum": "18626131234",
"conum": "2019042112120304586",
"hongb": "22",
"bmtime": "2019-04-21 12:12:12",
"downtime": "2019-04-21 12:12:12"
},
{
"userImg": "img",
"lusername": "南柯残梦",
"realname": "流SIR",
"telnum": "18626131234",
"conum": "2019042112120304586",
"hongb": "22",
"bmtime": "2019-04-21 12:12:12",
"downtime": "2019-04-21 12:12:12"
},
{
"userImg": "img",
"lusername": "南柯残梦",
"realname": "流SIR",
"telnum": "18626131234",
"conum": "2019042112120304586",
"hongb": "22",
"bmtime": "2019-04-21 12:12:12",
"downtime": "2019-04-21 12:12:12"
},
{
"userImg": "img",
"lusername": "南柯残梦",
"realname": "流SIR",
"telnum": "18626131234",
"conum": "2019042112120304586",
"hongb": "22",
"bmtime": "2019-04-21 12:12:12",
"downtime": "2019-04-21 12:12:12"
},
{
"userImg": "img",
"lusername": "南柯残梦",
"realname": "流SIR",
"telnum": "18626131234",
"conum": "2019042112120304586",
"hongb": "22",
"bmtime": "2019-04-21 12:12:12",
"downtime": "2019-04-21 12:12:12"
},
{
"userImg": "img",
"lusername": "南柯残梦",
"realname": "流SIR",
"telnum": "18626131234",
"conum": "2019042112120304586",
"hongb": "22",
"bmtime": "2019-04-21 12:12:12",
"downtime": "2019-04-21 12:12:12"
},
{
"userImg": "img",
"lusername": "南柯残梦",
"realname": "流SIR",
"telnum": "18626131234",
"conum": "2019042112120304586",
"hongb": "22",
"bmtime": "2019-04-21 12:12:12",
"downtime": "2019-04-21 12:12:12"
},
{
"userImg": "img",
"lusername": "南柯残梦",
"realname": "流SIR",
"telnum": "18626131234",
"conum": "2019042112120304586",
"hongb": "22",
"bmtime": "2019-04-21 12:12:12",
"downtime": "2019-04-21 12:12:12"
}
]
,
tableData:[]
};
} ,
methods: {
tableRowClassName({row, rowIndex}) {
if (rowIndex === 0) {
return 'th';
}
return '';
},
switchChange(){
this.istag = !this.istag ;
},
created:function(){
this.total=this.lists.length;
},
current_change:function(currentPage){
this.currentPage = currentPage;
}
}
}
数据为写死的data
效果为上图
样式表
.el-table td, .el-table th.is-leaf{
border: none !important;
color:black;
}
.el-table--striped .el-table__body tr.el-table__row--striped td{
background-color:#fff;
}
.el-table th>.cell{
font-size:16px !important;
}
.el-table::before{
height: 0px !important;
}
.fy{
margin-top: 25px;
height: 58px;
text-align: center;
}
.el-pager li.active+li {
border-left:1px !important;
}