update Gallery view to work with url params
This commit is contained in:
+13
-3
@@ -28,7 +28,7 @@
|
||||
|
||||
<side-view id="gallery-index" right>
|
||||
<template #default="{ hide }">
|
||||
<ul>
|
||||
<ul v-if="creations">
|
||||
<li v-for="crea in creations" :key="crea.id">
|
||||
<node-view-title
|
||||
:node="crea"
|
||||
@@ -54,7 +54,7 @@
|
||||
</b-modal>
|
||||
|
||||
<b-overlay
|
||||
:show="!creation"
|
||||
:show="!creations || !creation"
|
||||
spinner-variant="creation"
|
||||
no-wrap
|
||||
/>
|
||||
@@ -80,6 +80,10 @@ export default {
|
||||
NodeViewTitle
|
||||
},
|
||||
|
||||
props: {
|
||||
id: { type: [Number, String], default: undefined }
|
||||
},
|
||||
|
||||
computed: {
|
||||
...mapGetters(['creations', 'creation'])
|
||||
},
|
||||
@@ -95,8 +99,14 @@ export default {
|
||||
}
|
||||
},
|
||||
|
||||
watch: {
|
||||
id (id, prev) {
|
||||
this.$store.dispatch('DISPLAY_CREATION', parseInt(this.id))
|
||||
}
|
||||
},
|
||||
|
||||
created () {
|
||||
this.$store.dispatch('INIT_GALLERY')
|
||||
this.$store.dispatch('INIT_GALLERY', parseInt(this.id))
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user