<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>