frontend: serialize current page to hash instead of query (and use setters for it)
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
parent
23a04a3b52
commit
83234769d6
|
@ -38,11 +38,16 @@ export default {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
page () {
|
page: {
|
||||||
if (this.$route.query.page) {
|
get () {
|
||||||
return parseInt(this.$route.query.page - 1)
|
if (this.$route.hash) {
|
||||||
} else {
|
return this.$route.hash.substr(1) - 1
|
||||||
return 0
|
} else {
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
},
|
||||||
|
set (value) {
|
||||||
|
this.$router.push({ hash: '#' + (value + 1) })
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -56,7 +61,7 @@ export default {
|
||||||
|
|
||||||
// set page
|
// set page
|
||||||
if (page >= 0 && page < this.info.pages.length) {
|
if (page >= 0 && page < this.info.pages.length) {
|
||||||
this.$router.push({ query: { page: page + 1 } })
|
this.page = page
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
Reference in a new issue