From 62005141132da1e9761598fa3e4b35b4dab38a89 Mon Sep 17 00:00:00 2001 From: Zero~Informatique Date: Sat, 21 Dec 2019 02:06:02 +0100 Subject: Implemented VueX and a basic UIStore with the fullscreen mutation Some renaming --- viewer/src/plugins/fontawesome.js | 9 --------- viewer/src/plugins/fontawesome.ts | 9 +++++++++ viewer/src/plugins/vuex.ts | 23 +++++++++++++++++++++++ 3 files changed, 32 insertions(+), 9 deletions(-) delete mode 100644 viewer/src/plugins/fontawesome.js create mode 100644 viewer/src/plugins/fontawesome.ts create mode 100644 viewer/src/plugins/vuex.ts (limited to 'viewer/src/plugins') diff --git a/viewer/src/plugins/fontawesome.js b/viewer/src/plugins/fontawesome.js deleted file mode 100644 index 9bf4dba..0000000 --- a/viewer/src/plugins/fontawesome.js +++ /dev/null @@ -1,9 +0,0 @@ -import Vue from "vue"; - -import { library } from "@fortawesome/fontawesome-svg-core"; -import { faExpandArrowsAlt } from "@fortawesome/free-solid-svg-icons"; -import { FontAwesomeIcon } from "@fortawesome/vue-fontawesome"; - -library.add(faExpandArrowsAlt); - -Vue.component("fa-icon", FontAwesomeIcon); diff --git a/viewer/src/plugins/fontawesome.ts b/viewer/src/plugins/fontawesome.ts new file mode 100644 index 0000000..9bf4dba --- /dev/null +++ b/viewer/src/plugins/fontawesome.ts @@ -0,0 +1,9 @@ +import Vue from "vue"; + +import { library } from "@fortawesome/fontawesome-svg-core"; +import { faExpandArrowsAlt } from "@fortawesome/free-solid-svg-icons"; +import { FontAwesomeIcon } from "@fortawesome/vue-fontawesome"; + +library.add(faExpandArrowsAlt); + +Vue.component("fa-icon", FontAwesomeIcon); diff --git a/viewer/src/plugins/vuex.ts b/viewer/src/plugins/vuex.ts new file mode 100644 index 0000000..9b2fa46 --- /dev/null +++ b/viewer/src/plugins/vuex.ts @@ -0,0 +1,23 @@ +import Vue from 'vue' +import Vuex from 'vuex' +import { extractVuexModule } from "vuex-class-component"; +import { createProxy } from "vuex-class-component"; +import UIStore from '@/store/uiStore'; + +Vue.use(Vuex) + +const store = new Vuex.Store({ + modules: { + ...extractVuexModule(UIStore) + } +}); + +Vue.use((vue) => vue.prototype.$uiStore = createProxy(store, UIStore)); + +declare module 'vue/types/vue' { + interface Vue { + $uiStore: UIStore + } +} + +export default store; -- cgit v1.2.3