-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.js
84 lines (70 loc) · 1.51 KB
/
main.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
import Vue, { createApp } from "vue"
import { createStore } from "vuex";
import App from "./App.vue"
import VueTippy from 'vue-tippy'
import 'tippy.js/dist/tippy.css' // optional for styling
import Playground from "./components/Playground.vue";
import Creator from "./components/Creator.vue";
import Home from "./components/Home.vue";
const routes = [
{ path: '/playground', component: Playground },
{ path: '/creator', component: Creator },
{ path: '/', component: Home },
{ path: '/:pathMatch(.*)*', redirect: '/' }
]
import { createRouter, createWebHistory } from 'vue-router'
const router = createRouter({
history: createWebHistory(),
routes,
mode: 'history'
})
const moduleA = {
state() {
return {
output: "",
outputErr: ""
}
},
mutations: {
changeOutput(state, output) {
state.output = output;
},
changeOutputErr(state, outputErr) {
state.outputErr = outputErr;
}
}
}
const moduleB = {
state() {
return {
keywords: {}
}
},
mutations: {
addKeyword(state, key, value) {
state.keywords[key] = value;
},
removeKeyword(state, key) {
delete state.keywords[key];
}
}
}
const store = createStore({
modules: {
a: moduleA,
b: moduleB
}
})
// new Vue({
// components: { App },
// template: "<App />",
// }).$mount("#app");
const app = createApp(App).use(store).use(router);
app.use(
VueTippy,
{
directive: 'tippy', // => v-tippy
component: 'tippy', // => <tippy/>
}
)
app.mount("#app");