From 3f21d10338afe8eab699aaaea060556579e4b3c3 Mon Sep 17 00:00:00 2001 From: Zero~Informatique Date: Sat, 21 Dec 2019 10:33:21 +0100 Subject: viewer: Some renaming for better clarity Implemented a basic display of filenames with basic navigation --- viewer/src/main.ts | 4 +- viewer/src/router/index.ts | 10 ++-- viewer/src/store/galleryStore.ts | 5 +- viewer/src/views/Gallery.vue | 60 +++++++++++++++++++++++ viewer/src/views/LdGallery.vue | 100 --------------------------------------- viewer/src/views/MainLayout.vue | 100 +++++++++++++++++++++++++++++++++++++++ viewer/src/views/Root.vue | 18 ------- 7 files changed, 172 insertions(+), 125 deletions(-) create mode 100644 viewer/src/views/Gallery.vue delete mode 100644 viewer/src/views/LdGallery.vue create mode 100644 viewer/src/views/MainLayout.vue delete mode 100644 viewer/src/views/Root.vue (limited to 'viewer') diff --git a/viewer/src/main.ts b/viewer/src/main.ts index 06fe8f8..736e6c7 100644 --- a/viewer/src/main.ts +++ b/viewer/src/main.ts @@ -6,7 +6,7 @@ import "@/plugins/buefy"; import store from '@/store' import i18n from "@/plugins/i18n"; import router from "@/router"; -import LdGallery from "@/views/LdGallery.vue"; +import MainLayout from "@/views/MainLayout.vue"; Vue.config.productionTip = false; @@ -14,5 +14,5 @@ new Vue({ router, i18n, store, - render: h => h(LdGallery) + render: h => h(MainLayout) }).$mount("#ldgallery"); diff --git a/viewer/src/router/index.ts b/viewer/src/router/index.ts index 03ae1cd..f228422 100644 --- a/viewer/src/router/index.ts +++ b/viewer/src/router/index.ts @@ -1,13 +1,17 @@ import Vue from "vue"; import VueRouter from "vue-router"; +import Gallery from "@/views/Gallery.vue"; Vue.use(VueRouter); +// async way : component: () => import(/* webpackChunkName: "Gallery" */ "@/views/Gallery.vue"), + const routes = [ { - path: "/", - name: "root", - component: () => import(/* webpackChunkName: "root" */ "@/views/Root.vue"), + path: "*", + name: "Gallery", + component: Gallery, + props: true }, ]; diff --git a/viewer/src/store/galleryStore.ts b/viewer/src/store/galleryStore.ts index 63e5109..4751561 100644 --- a/viewer/src/store/galleryStore.ts +++ b/viewer/src/store/galleryStore.ts @@ -7,9 +7,9 @@ const VuexModule = createModule({ export default class GalleryStore extends VuexModule { - galleryItems: Gallery.Item[] = []; + galleryItems: Gallery.Item | null = null; - @mutation setGalleryItems(galleryItems: Gallery.Item[]) { + @mutation setGalleryItems(galleryItems: Gallery.Item) { this.galleryItems = galleryItems; } @@ -18,4 +18,5 @@ export default class GalleryStore extends VuexModule { .then(response => response.json()) .then(this.setGalleryItems); } + } \ No newline at end of file diff --git a/viewer/src/views/Gallery.vue b/viewer/src/views/Gallery.vue new file mode 100644 index 0000000..3625838 --- /dev/null +++ b/viewer/src/views/Gallery.vue @@ -0,0 +1,60 @@ + + + + + diff --git a/viewer/src/views/LdGallery.vue b/viewer/src/views/LdGallery.vue deleted file mode 100644 index 04474c3..0000000 --- a/viewer/src/views/LdGallery.vue +++ /dev/null @@ -1,100 +0,0 @@ - - - - - \ No newline at end of file diff --git a/viewer/src/views/MainLayout.vue b/viewer/src/views/MainLayout.vue new file mode 100644 index 0000000..9f3a17b --- /dev/null +++ b/viewer/src/views/MainLayout.vue @@ -0,0 +1,100 @@ + + + + + \ No newline at end of file diff --git a/viewer/src/views/Root.vue b/viewer/src/views/Root.vue deleted file mode 100644 index 384dcbe..0000000 --- a/viewer/src/views/Root.vue +++ /dev/null @@ -1,18 +0,0 @@ - - - - - -- cgit v1.2.3