From c7654c000534bcebbdda3f4f95c09e6c6d563948 Mon Sep 17 00:00:00 2001 From: ManjaroOne666 Date: Mon, 28 Jan 2019 09:57:48 +0000 Subject: [PATCH] set image index in query string --- components/GalleryPage.vue | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/components/GalleryPage.vue b/components/GalleryPage.vue index 377bc2a..9924162 100644 --- a/components/GalleryPage.vue +++ b/components/GalleryPage.vue @@ -66,19 +66,31 @@ export default { methods: { handleFeaturedClick (index) { this.activeRow = index + this.activeImageIndex = 0 this.activeGalleryIndex = index - this.$router.push({path: this.$route.path, query: { gallery: this.galleries[index].id}}) + this.setQueryString() }, handleThumbClick(gallery, image) { this.activeGalleryIndex = gallery this.activeImageIndex = image this.imageViewerIsVisible = true + this.setQueryString() }, handleClickNext () { this.activeImageIndex++; }, handleClickPrev () { this.activeImageIndex--; + }, + setQueryString () { + this.$router.push({ + path: this.$route.path, + query: { + gallery: this.activeGalleryIndex, + image: this.activeImageIndex, + + }, + }) } } }