From 20434ab52a62d56c913bc4011b640845f1fca289 Mon Sep 17 00:00:00 2001 From: Gator Date: Wed, 30 Nov 2022 19:37:35 +0100 Subject: [PATCH] new global api for vue and vuex --- src/App.vue | 3 +-- src/main.js | 13 ++++++------- src/store/index.js | 7 ++----- 3 files changed, 9 insertions(+), 14 deletions(-) diff --git a/src/App.vue b/src/App.vue index 379637c..cf18b8c 100644 --- a/src/App.vue +++ b/src/App.vue @@ -12,8 +12,7 @@ import MainMenu from "./components/MainMenu.vue"; import CanvasBoard from "./components/CanvasBoard.vue"; -export default { - name: "App", +export const App = { components: { MainMenu, CanvasBoard, diff --git a/src/main.js b/src/main.js index 1f764d8..654699f 100644 --- a/src/main.js +++ b/src/main.js @@ -1,10 +1,9 @@ -import Vue from "vue"; +import { createApp } from 'vue' import App from "./App.vue"; -import store from "./store"; +import { store } from "./store"; -Vue.config.productionTip = false; +const app = createApp(App) -new Vue({ - store, - render: (h) => h(App), -}).$mount("#app"); +app.use(store) + +app.mount('#app') diff --git a/src/store/index.js b/src/store/index.js index 4847d02..82c3907 100644 --- a/src/store/index.js +++ b/src/store/index.js @@ -1,9 +1,6 @@ -import Vue from "vue"; -import Vuex from "vuex"; +import { createStore } from 'vuex' -Vue.use(Vuex); - -export default new Vuex.Store({ +export const store = createStore({ state: { drawing: 0, rules1d: {