搖曳的薔薇
2019-03-27 21:19:17
element Ui 分頁(yè)size-change事件觸發(fā)同時(shí)也出發(fā)了current-change事件,導(dǎo)致調(diào)用兩次接口<el-pagination @size-change="handleSizeChange" @current-change="handleCurrentChange" :current-page.sync="pageInfo.PageNum" :page-sizes="[5, 10, 20]" :page-size="pageInfo.PageSize" layout="total, sizes, prev, pager, next, jumper" :total="pageInfo.Total"></el-pagination> //pageSize變化事件 handleSizeChange(val) { this.$emit("sizeChange", val); }, //pageNum變化事件 handleCurrentChange() { this.$emit("pageNumCheng"); }
2 回答

慕田峪9158850
TA貢獻(xiàn)1794條經(jīng)驗(yàn) 獲得超7個(gè)贊

桃花長(zhǎng)相依
TA貢獻(xiàn)1860條經(jīng)驗(yàn) 獲得超8個(gè)贊
handleSizeChange(val) {
this.options.limit = val;
this.getData();
},
handleCurrentChange(val) {
this.options.offset = this.options.limit * (val - 1);
this.getData();
}
添加回答
舉報(bào)
0/150
提交
取消