-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathapp.js
69 lines (66 loc) · 1.53 KB
/
app.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
Vue.config.devtools = true;
Vue.use(VueRouter);
const router = new VueRouter({
mode: 'history',
base: '/',
routes: [
{
path: '*',
name: '404',
component: httpVueLoader('/components/NotFound.vue')
},
{
path: '/',
name: 'home',
component: httpVueLoader('/components/BasePage.vue'),
props: () => ({
file: '/content/about.md'
})
},
{
path: '/enrollment',
name: 'enrollment',
component: httpVueLoader('/components/BasePage.vue'),
props: () => ({
file: '/content/enrollment.md'
})
},
{
path: '/volunteer',
name: 'volunteer',
component: httpVueLoader('/components/BasePage.vue'),
props: () => ({
file: '/content/volunteer.md'
})
},
{
path: '/classContent',
name: 'classContent',
component: httpVueLoader('/components/BasePage.vue'),
props: () => ({
file: '/content/classContent.md'
})
},
{
path: '/streaming',
name: 'liveStream',
component: httpVueLoader('/components/LiveStream.vue')
}
]
});
// eslint-disable-next-line no-unused-vars
const app = new Vue({
el: '#app',
template: '<app-composition></app-composition>',
components: {
'app-composition': httpVueLoader('/components/app-composition.vue')
},
router,
created () {
const redirect = sessionStorage.redirect;
delete sessionStorage.redirect;
if (redirect && redirect !== location.href) {
this.$router.push(redirect);
}
}
});