|
@@ -21,7 +21,10 @@
|
|
|
<el-pagination
|
|
|
@size-change="handleSizeChange"
|
|
|
@current-change="handleCurrentChange"
|
|
|
- :current-page="currentPage"
|
|
|
+ :current-page.sync="currentPage"
|
|
|
+ :page-sizes="[10, 20, 30, 40]"
|
|
|
+ :page-size.sync="limit"
|
|
|
+ background
|
|
|
layout="total, prev, pager, next, jumper"
|
|
|
:total="total"
|
|
|
>
|
|
@@ -44,8 +47,9 @@ export default {
|
|
|
data: () => {
|
|
|
return {
|
|
|
list: [],
|
|
|
- total: 0,
|
|
|
currentPage: 1,
|
|
|
+ limit: 10,
|
|
|
+ total: 0,
|
|
|
};
|
|
|
},
|
|
|
created() {
|
|
@@ -69,14 +73,14 @@ export default {
|
|
|
},
|
|
|
click(id) {
|
|
|
this.$router.push({ path: '/live/detail', query: { id: id } });
|
|
|
- console.log(id);
|
|
|
},
|
|
|
|
|
|
handleSizeChange(val) {
|
|
|
- console.log(`每页 ${val} 条`);
|
|
|
+ this.$set(this, `currentPage`, 1);
|
|
|
+ this.searchList({ skip: 0, limit: val });
|
|
|
},
|
|
|
handleCurrentChange(val) {
|
|
|
- console.log(`当前页: ${val}`);
|
|
|
+ this.searchList({ skip: (val - 1) * this.limit, limit: this.limit });
|
|
|
},
|
|
|
},
|
|
|
computed: {
|