diff --git a/package-lock.json b/package-lock.json index 89c9b40..6f0e5ad 100644 --- a/package-lock.json +++ b/package-lock.json @@ -14408,6 +14408,11 @@ } } }, + "vuex": { + "version": "3.4.0", + "resolved": "https://registry.npmjs.org/vuex/-/vuex-3.4.0.tgz", + "integrity": "sha512-ajtqwEW/QhnrBZQsZxCLHThZZaa+Db45c92Asf46ZDXu6uHXgbfVuBaJ4gzD2r4UX0oMJHstFwd2r2HM4l8umg==" + }, "w3c-hr-time": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/w3c-hr-time/-/w3c-hr-time-1.0.2.tgz", diff --git a/package.json b/package.json index 6f5e9b1..93c3d4a 100644 --- a/package.json +++ b/package.json @@ -27,7 +27,8 @@ "tiptap-vuetify": "^2.24.0", "vue": "~2.6.11", "vue-router": "~3.5.3", - "vuetify": "~2.4.0" + "vuetify": "~2.4.0", + "vuex": "~3.4.0" }, "devDependencies": { "@vue/cli-plugin-babel": "~4.5.0", diff --git a/src/framework/actionSheet/index.js b/src/framework/actionSheet/index.js index 72a128c..9189ad1 100644 --- a/src/framework/actionSheet/index.js +++ b/src/framework/actionSheet/index.js @@ -2,6 +2,7 @@ import Vue from 'vue' import ActionSheet from './ActionSheet.vue' import Vuetify from 'vuetify/lib' import { Router } from "../../plugins/router.js" +import { Store } from '../../plugins/store.js' /* Usage: * actionSheet({ @@ -22,7 +23,8 @@ const ActionSheetConstructor = Vue.extend(ActionSheet) function createCmp(options) { const cmp = new ActionSheetConstructor({ - router: Router.instance + router: Router.instance, + store: Store.instance }); const vuetifyObj = new Vuetify() diff --git a/src/framework/banner/index.js b/src/framework/banner/index.js index f324a7b..e24b5e4 100644 --- a/src/framework/banner/index.js +++ b/src/framework/banner/index.js @@ -2,6 +2,7 @@ import Vue from 'vue' import Banner from './Banner.vue' import Vuetify from 'vuetify/lib' import { Router } from "../../plugins/router.js" +import { Store } from '../../plugins/store.js' /* Usage: * banner({ @@ -16,7 +17,8 @@ const BannerConstructor = Vue.extend(Banner) function createCmp(options) { const cmp = new BannerConstructor({ - router: Router.instance + router: Router.instance, + store: Store.instance }); const vuetifyObj = new Vuetify() diff --git a/src/framework/dialog/index.js b/src/framework/dialog/index.js index c7fa122..3d04f89 100644 --- a/src/framework/dialog/index.js +++ b/src/framework/dialog/index.js @@ -2,6 +2,7 @@ import Vue from 'vue' import Dialog from './Dialog.vue' import Vuetify from 'vuetify/lib' import { Router } from "../../plugins/router.js" +import { Store } from '../../plugins/store.js' /* Usage: * dialog(MyComponent, options) @@ -13,7 +14,8 @@ function createCmp(childComponent, options) { // Instantiate dialog const cmp = new DialogConstructor({ - router: Router.instance + router: Router.instance, + store: Store.instance }); const vuetifyObj = new Vuetify() diff --git a/src/framework/loading/index.js b/src/framework/loading/index.js index 91c7148..c8a6dc2 100644 --- a/src/framework/loading/index.js +++ b/src/framework/loading/index.js @@ -2,6 +2,7 @@ import Vue from 'vue' import Loading from './Loading.vue' import Vuetify from 'vuetify/lib' import { Router } from "../../plugins/router.js" +import { Store } from '../../plugins/store.js' /* Usage: * var l = loading() @@ -16,7 +17,8 @@ var depth = 0; function createCmp(options) { const cmp = new LoadingConstructor({ - router: Router.instance + router: Router.instance, + store: Store.instance }); const vuetifyObj = new Vuetify() diff --git a/src/framework/messageBox/index.js b/src/framework/messageBox/index.js index ddf0be8..772421b 100644 --- a/src/framework/messageBox/index.js +++ b/src/framework/messageBox/index.js @@ -2,6 +2,7 @@ import Vue from 'vue' import MessageBox from './MessageBox.vue' import Vuetify from 'vuetify/lib' import { Router } from "../../plugins/router.js" +import { Store } from '../../plugins/store.js' /* Usage: * messageBox({ @@ -18,7 +19,8 @@ const MessageBoxConstructor = Vue.extend(MessageBox) function createCmp(options) { const cmp = new MessageBoxConstructor({ - router: Router.instance + router: Router.instance, + store: Store.instance }); const vuetifyObj = new Vuetify() diff --git a/src/framework/toast/index.js b/src/framework/toast/index.js index 4fedecb..1926ab6 100644 --- a/src/framework/toast/index.js +++ b/src/framework/toast/index.js @@ -2,6 +2,7 @@ import Vue from 'vue' import Toast from './Toast.vue' import Vuetify from 'vuetify/lib' import { Router } from "../../plugins/router.js" +import { Store } from '../../plugins/store.js' /* Usage: * toast({ @@ -21,7 +22,8 @@ const toasts = [] function createCmp(options) { const cmp = new ToastConstructor({ - router: Router.instance + router: Router.instance, + store: Store.instance }); const vuetifyObj = new Vuetify() diff --git a/src/plugin.js b/src/plugin.js index f817225..aff7d75 100644 --- a/src/plugin.js +++ b/src/plugin.js @@ -2,6 +2,7 @@ import { override } from "./app/settings.js"; import { useVuetify } from "./plugins/vuetify.js"; import { useTipTapVuetify } from "./plugins/tiptap-vuetify.js"; import { useRouter } from "./plugins/router.js"; +import { useStore } from "./plugins/store.js"; import SharedoAuth from "./infra/authcode.js"; import SharedoFetch from "./infra/fetchWrapper.js"; @@ -53,6 +54,7 @@ export { useVuetify, useTipTapVuetify, useRouter, + useStore, // Services SharedoAuth, diff --git a/src/plugins/store.js b/src/plugins/store.js new file mode 100644 index 0000000..172c031 --- /dev/null +++ b/src/plugins/store.js @@ -0,0 +1,17 @@ +import Vue from 'vue' +import Vuex from "vuex"; + +Vue.use(Vuex); + +class Store { } + +const useStore = config => { + Store.instance = new Vuex.Store(config); + + return Store.instance; +} + +export { + Store, + useStore +} \ No newline at end of file