// Template
<el-pagination
v-if="titleData.length>0"
:current-page="pageNo"
:page-size="pageSize"
layout="total, prev, pager, next, jumper"
:total="total"
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
/>
// JS
data() {
return {
total: 0, // 总数
pageNo: 1, // 第一页
pageSize: 50, // 每页条数
}
},
methods: {
/**
* 分页处理
*/
handleSizeChange(val) {
this.pageSize = val
this.pageNo = 1
this.getRealTimeAlarmList()
},
handleCurrentChange(val) {
this.pageNo = val
this.getRealTimeAlarmList()
}
}