Skip to content
This repository was archived by the owner on May 13, 2024. It is now read-only.

Commit 6f914d9

Browse files
tolkingbillyyyyy3320
authored andcommitted
fix: Pagination Number by computed
1 parent 9298896 commit 6f914d9

File tree

1 file changed

+4
-9
lines changed

1 file changed

+4
-9
lines changed

Diff for: src/client/components/Pagination.vue

+4-9
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<component
33
v-if="comp"
44
:is="comp"
5-
v-model="page"
5+
:value="page"
66
:page-count="$pagination.length"
77
:click-handler="clickCallback"
88
:prev-text="'Prev'"
@@ -16,21 +16,16 @@
1616
export default {
1717
data() {
1818
return {
19-
page: 0,
2019
comp: null,
2120
}
2221
},
2322
24-
watch: {
25-
$pagination() {
26-
this.page = this.$pagination.paginationIndex + 1
23+
computed: {
24+
page() {
25+
return this.$pagination.paginationIndex + 1
2726
}
2827
},
2928
30-
created() {
31-
this.page = this.$pagination.paginationIndex + 1
32-
},
33-
3429
mounted() {
3530
import(/* webpackChunkName: "vuejs-paginate" */ 'vuejs-paginate').then(comp => {
3631
this.comp = comp.default

0 commit comments

Comments
 (0)