<script >
export default {
data() {
return {
total: 100,
pageSize: 5,
pageNo: 1,
}
},
created() {
this.pageNo = Number(localStorage.getItem(‘pagination‘)) || 1;
this.pageChange(this.pageNo);
},
beforeUpdate() {
localStorage.setItem(‘pagination‘, this.pageNo);
},
beforeDestroy() {
localStorage.setItem(‘pagination‘, ‘1‘);
},
methods: {
pageChange(pageNo) {
this.loading = true;
this.pageNo = pageNo;
}
}
}
</script>
原文地址:https://www.cnblogs.com/wplcc/p/11031601.html
时间: 2024-10-04 05:39:20