-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.ts
50 lines (41 loc) · 1.12 KB
/
main.ts
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
import 'lazysizes'
import Vue from 'vue'
import Root from './Root.vue'
import IMGNRY from './IMGNRY'
// import LoadScript from 'vue-plugin-load-script'
// Vue.use(LoadScript)
import VueRouter from 'vue-router'
Vue.use(VueRouter)
import Kristofer from './Kristofer.vue'
import Fille from './Fille.vue'
Vue.use({
install(Vue) {
Vue.prototype.$loadScript = function(path) {
return new Promise((resolve, reject) => {
const script = document.createElement('script')
script.type = 'text/javascript'
script.async = true
script.onload = () => resolve()
script.onerror = () => reject(new Error('Failed to load script: ' + path))
script.src = path
document.head.appendChild(script)
})
}
},
})
import './nightsky'
const routes = [
{ path: '/', component: IMGNRY },
{ path: '/kristofer', component: Kristofer },
{ path: '/fille', component: Fille },
]
const router = new VueRouter({
mode: 'history',
routes,
})
document.addEventListener('DOMContentLoaded', () => {
new Vue({
router,
render: createElement => createElement(Root),
}).$mount('#app')
})