added query parameters to galleries page

This commit is contained in:
ManjaroOne666 2019-01-28 08:47:48 +00:00
parent de4ef67c37
commit f603a8bc87
3 changed files with 17 additions and 0 deletions

View File

@ -17,6 +17,13 @@ export default {
type: Array, type: Array,
required: true required: true
}, },
galleryActive: {
type: Number,
required: false,
default () {
return 0
},
}
}, },
} }
</script> </script>

View File

@ -12,6 +12,7 @@
<h1 class="page-heading page-title">My Galleries</h1> <h1 class="page-heading page-title">My Galleries</h1>
<GalleryFeatured class="gallery__featured" <GalleryFeatured class="gallery__featured"
:galleries="galleries" :galleries="galleries"
:gallery-active="activeGalleryIndex"
@clicked="handleFeaturedClick" /> @clicked="handleFeaturedClick" />
<GalleryThumbs class="gallery__thumbs" <GalleryThumbs class="gallery__thumbs"
:featured-height="featuredImageHeight" :featured-height="featuredImageHeight"
@ -64,6 +65,8 @@ export default {
methods: { methods: {
handleFeaturedClick (index) { handleFeaturedClick (index) {
this.activeRow = index this.activeRow = index
this.activeGalleryIndex = index
this.$router.push({path: this.$route.path, query: { gallery: this.galleries[index].id}})
}, },
handleThumbClick(gallery, image) { handleThumbClick(gallery, image) {
this.activeGalleryIndex = gallery this.activeGalleryIndex = gallery

View File

@ -17,6 +17,7 @@ export default {
return { return {
galleries: [ galleries: [
{ title: 'Portraits', { title: 'Portraits',
id: '1',
featuredImage: 'https://marcleopold.isnet.uk/wp-content/uploads/2017/07/portraits-4-600x400.jpeg', featuredImage: 'https://marcleopold.isnet.uk/wp-content/uploads/2017/07/portraits-4-600x400.jpeg',
images: [ images: [
{ thumbUrl: 'https://marcleopold.isnet.uk/wp-content/uploads/2017/07/portraits-4-600x400.jpeg', url: 'https://marcleopold.isnet.uk/wp-content/uploads/2017/07/portraits-4-1800x1200.jpeg' }, { thumbUrl: 'https://marcleopold.isnet.uk/wp-content/uploads/2017/07/portraits-4-600x400.jpeg', url: 'https://marcleopold.isnet.uk/wp-content/uploads/2017/07/portraits-4-1800x1200.jpeg' },
@ -26,6 +27,7 @@ export default {
] ]
}, },
{ title: 'Flowers', { title: 'Flowers',
id: '2',
featuredImage: 'https://marcleopold.isnet.uk/wp-content/uploads/2017/07/flowers-5-600x402.jpeg', featuredImage: 'https://marcleopold.isnet.uk/wp-content/uploads/2017/07/flowers-5-600x402.jpeg',
images: [ images: [
{ thumbUrl: 'https://via.placeholder.com/400x300/ff0000/ffffff', url: 'https://via.placeholder.com/1920x1080/ff0000/ffffff?text=One0' }, { thumbUrl: 'https://via.placeholder.com/400x300/ff0000/ffffff', url: 'https://via.placeholder.com/1920x1080/ff0000/ffffff?text=One0' },
@ -39,6 +41,7 @@ export default {
] ]
}, },
{ title: 'The Longest Title for a Gallery That You Could Ever Imagine (Unless You Have a Really Good Imagination - And Then You Could Probably Think of a Really Big One)', { title: 'The Longest Title for a Gallery That You Could Ever Imagine (Unless You Have a Really Good Imagination - And Then You Could Probably Think of a Really Big One)',
id: '3',
featuredImage: 'https://marcleopold.isnet.uk/wp-content/uploads/2017/07/music-4-600x400.jpg', featuredImage: 'https://marcleopold.isnet.uk/wp-content/uploads/2017/07/music-4-600x400.jpg',
images: [ images: [
{ thumbUrl: 'https://via.placeholder.com/400x300', url: 'https://via.placeholder.com/1920x1080' }, { thumbUrl: 'https://via.placeholder.com/400x300', url: 'https://via.placeholder.com/1920x1080' },
@ -48,6 +51,7 @@ export default {
] ]
}, },
{ title: 'Gallery Three', { title: 'Gallery Three',
id: '4',
featuredImage: 'https://via.placeholder.com/600x400', featuredImage: 'https://via.placeholder.com/600x400',
images: [ images: [
{ thumbUrl: 'https://via.placeholder.com/400x300', url: 'https://via.placeholder.com/1920x1080' }, { thumbUrl: 'https://via.placeholder.com/400x300', url: 'https://via.placeholder.com/1920x1080' },
@ -57,6 +61,7 @@ export default {
] ]
}, },
{ title: 'Gallery Four', { title: 'Gallery Four',
id: '5',
featuredImage: 'https://via.placeholder.com/600x400', featuredImage: 'https://via.placeholder.com/600x400',
images: [ images: [
{ thumbUrl: 'https://via.placeholder.com/400x300', url: 'https://via.placeholder.com/1920x1080' }, { thumbUrl: 'https://via.placeholder.com/400x300', url: 'https://via.placeholder.com/1920x1080' },
@ -66,6 +71,7 @@ export default {
] ]
}, },
{ title: 'Gallery Five', { title: 'Gallery Five',
id: '6',
featuredImage: 'https://via.placeholder.com/600x400', featuredImage: 'https://via.placeholder.com/600x400',
images: [ images: [
{ thumbUrl: 'https://via.placeholder.com/400x300', url: 'https://via.placeholder.com/1920x1080' }, { thumbUrl: 'https://via.placeholder.com/400x300', url: 'https://via.placeholder.com/1920x1080' },
@ -75,6 +81,7 @@ export default {
] ]
}, },
{ title: 'Gallery Six', { title: 'Gallery Six',
id: '7',
featuredImage: 'https://via.placeholder.com/600x400', featuredImage: 'https://via.placeholder.com/600x400',
images: [ images: [
{ thumbUrl: 'https://via.placeholder.com/400x300', url: 'https://via.placeholder.com/1920x1080' }, { thumbUrl: 'https://via.placeholder.com/400x300', url: 'https://via.placeholder.com/1920x1080' },