set image index in query string

This commit is contained in:
ManjaroOne666 2019-01-28 09:57:48 +00:00
parent f0ded60d7d
commit c7654c0005
1 changed files with 13 additions and 1 deletions

View File

@ -66,19 +66,31 @@ export default {
methods: { methods: {
handleFeaturedClick (index) { handleFeaturedClick (index) {
this.activeRow = index this.activeRow = index
this.activeImageIndex = 0
this.activeGalleryIndex = index this.activeGalleryIndex = index
this.$router.push({path: this.$route.path, query: { gallery: this.galleries[index].id}}) this.setQueryString()
}, },
handleThumbClick(gallery, image) { handleThumbClick(gallery, image) {
this.activeGalleryIndex = gallery this.activeGalleryIndex = gallery
this.activeImageIndex = image this.activeImageIndex = image
this.imageViewerIsVisible = true this.imageViewerIsVisible = true
this.setQueryString()
}, },
handleClickNext () { handleClickNext () {
this.activeImageIndex++; this.activeImageIndex++;
}, },
handleClickPrev () { handleClickPrev () {
this.activeImageIndex--; this.activeImageIndex--;
},
setQueryString () {
this.$router.push({
path: this.$route.path,
query: {
gallery: this.activeGalleryIndex,
image: this.activeImageIndex,
},
})
} }
} }
} }