Skip to content

Commit

Permalink
reorganize initialization
Browse files Browse the repository at this point in the history
  • Loading branch information
TaiSakuma committed Oct 6, 2022
1 parent d6bedd5 commit ac0f4b0
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 7 deletions.
12 changes: 5 additions & 7 deletions src/main.ts
Original file line number Diff line number Diff line change
@@ -1,16 +1,14 @@
import Vue from "vue";
import router from "./router";
import vuetify from "./plugins/vuetify";
import { createPinia, PiniaVuePlugin, mapStores } from "pinia";
import { defineThemes } from "./monaco-editor";

import pinia from "@/stores";
import router from "@/router";
import vuetify from "@/plugins/vuetify";
import { defineThemes } from "@/monaco-editor";

import App from "@/app/AppWLoadConfig.vue";

Vue.use(PiniaVuePlugin);
Vue.config.productionTip = false;

const pinia = createPinia();

new Vue({
router,
vuetify,
Expand Down
5 changes: 5 additions & 0 deletions src/router/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@ import VueRouter, { RouteConfig } from "vue-router";
import HomeView from "../views/HomeView.vue";
import Runs from "@/views/Runs.vue";

// Pinia must be plugged in before the router if a store is used in a route
// https://github.com/vuejs/pinia/discussions/723#discussioncomment-2110660
// import { PiniaVuePlugin } from "pinia";
// Vue.use(PiniaVuePlugin);

Vue.use(VueRouter);

const routes: Array<RouteConfig> = [
Expand Down
6 changes: 6 additions & 0 deletions src/stores/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import Vue from "vue";
import { PiniaVuePlugin, createPinia } from "pinia";
Vue.use(PiniaVuePlugin);
const pinia = createPinia();

export default pinia;

0 comments on commit ac0f4b0

Please sign in to comment.