diff options
Diffstat (limited to 'viewer/src/views/GalleryNavigation.vue')
-rw-r--r-- | viewer/src/views/GalleryNavigation.vue | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/viewer/src/views/GalleryNavigation.vue b/viewer/src/views/GalleryNavigation.vue index fd1f19a..fdd3922 100644 --- a/viewer/src/views/GalleryNavigation.vue +++ b/viewer/src/views/GalleryNavigation.vue | |||
@@ -21,15 +21,15 @@ | |||
21 | <div> | 21 | <div> |
22 | <ld-error v-if="isError" icon="folder-open" :message="$t('gallery.unknown-resource')" /> | 22 | <ld-error v-if="isError" icon="folder-open" :message="$t('gallery.unknown-resource')" /> |
23 | <gallery-search v-else-if="isSearch" :path="path" /> | 23 | <gallery-search v-else-if="isSearch" :path="path" /> |
24 | <component :is="componentName" v-else :item="$galleryStore.currentItem" /> | 24 | <component :is="componentName" v-else :key="componentKey" :item="$galleryStore.currentItem" /> |
25 | </div> | 25 | </div> |
26 | </template> | 26 | </template> |
27 | 27 | ||
28 | <script lang="ts"> | 28 | <script lang="ts"> |
29 | import { Component, Vue, Prop, Watch } from "vue-property-decorator"; | ||
30 | import { ItemType } from "@/@types/ItemType"; | 29 | import { ItemType } from "@/@types/ItemType"; |
31 | import Navigation from "@/services/navigation"; | 30 | import Navigation from "@/services/navigation"; |
32 | import GallerySearch from "@/views/GallerySearch.vue"; | 31 | import GallerySearch from "@/views/GallerySearch.vue"; |
32 | import { Component, Prop, Vue, Watch } from "vue-property-decorator"; | ||
33 | 33 | ||
34 | @Component({ | 34 | @Component({ |
35 | components: { | 35 | components: { |
@@ -41,13 +41,13 @@ export default class GalleryNavigation extends Vue { | |||
41 | @Prop(Array) readonly query!: string[]; | 41 | @Prop(Array) readonly query!: string[]; |
42 | 42 | ||
43 | readonly COMPONENT_BY_TYPE: Record<ItemType, string> = { | 43 | readonly COMPONENT_BY_TYPE: Record<ItemType, string> = { |
44 | directory: "ld-directory", | 44 | directory: "ld-directory-viewer", |
45 | picture: "ld-picture", | 45 | picture: "ld-picture-viewer", |
46 | plaintext: "ld-plain-text-viewer", | 46 | plaintext: "ld-plain-text-viewer", |
47 | pdf: "ld-pdf-viewer", | 47 | pdf: "ld-pdf-viewer", |
48 | video: "ld-video-viewer", | 48 | video: "ld-video-viewer", |
49 | audio: "ld-audio-viewer", | 49 | audio: "ld-audio-viewer", |
50 | other: "ld-download", | 50 | other: "ld-download-viewer", |
51 | }; | 51 | }; |
52 | 52 | ||
53 | mounted() { | 53 | mounted() { |
@@ -66,6 +66,10 @@ export default class GalleryNavigation extends Vue { | |||
66 | return this.COMPONENT_BY_TYPE[this.$galleryStore.currentItem?.properties.type ?? ItemType.OTHER]; | 66 | return this.COMPONENT_BY_TYPE[this.$galleryStore.currentItem?.properties.type ?? ItemType.OTHER]; |
67 | } | 67 | } |
68 | 68 | ||
69 | get componentKey() { | ||
70 | return this.$galleryStore.currentItem?.path ?? ""; | ||
71 | } | ||
72 | |||
69 | @Watch("path") | 73 | @Watch("path") |
70 | pathChanged() { | 74 | pathChanged() { |
71 | this.$galleryStore.setCurrentPath(this.path); | 75 | this.$galleryStore.setCurrentPath(this.path); |
@@ -76,5 +80,3 @@ export default class GalleryNavigation extends Vue { | |||
76 | } | 80 | } |
77 | } | 81 | } |
78 | </script> | 82 | </script> |
79 | |||
80 | <style lang="scss"></style> | ||