diff --git a/components/btn/Pagination.vue b/components/btn/Pagination.vue index 4a1e3e23ad2bb303862c3ab38f33af8d193c479c..09b6daf9378cd9b5870a9e8ce1d787c90a158a5a 100644 --- a/components/btn/Pagination.vue +++ b/components/btn/Pagination.vue @@ -63,7 +63,7 @@ export default { }, methods: { goto(i, e) { - e.preventDefault() + if (e !== undefined) e.preventDefault() this.$emit("update:currentPage", i) }, firstPage: function (e) { @@ -94,6 +94,13 @@ export default { return [this.currentPage - 1, this.currentPage, this.currentPage + 1] } + }, + watch: { + arrayLength: { + handler(n, o) { + this.goto(1) + } + } } } </script>