update page on query string changes
This commit is contained in:
parent
05fd4e9792
commit
e415efe7bc
|
@ -68,6 +68,23 @@ export default {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
watch: {
|
||||||
|
$route () {
|
||||||
|
if (!query || !query.gallery) { return }
|
||||||
|
const query = this.$route.query
|
||||||
|
const gallery = parseInt(query.gallery)
|
||||||
|
const image = parseInt(query.image) || 0
|
||||||
|
|
||||||
|
if (gallery !== this.activeGalleryIndex) {
|
||||||
|
this.activeRow = gallery
|
||||||
|
this.activeGalleryIndex = gallery
|
||||||
|
}
|
||||||
|
if (image !== this.activeImageIndex) {
|
||||||
|
this.activeImageIndex = image
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
created () {
|
created () {
|
||||||
let query = this.$route.query
|
let query = this.$route.query
|
||||||
this.activeGalleryIndex = query.gallery ? parseInt(query.gallery) : 0
|
this.activeGalleryIndex = query.gallery ? parseInt(query.gallery) : 0
|
||||||
|
|
Loading…
Reference in New Issue