-
Notifications
You must be signed in to change notification settings - Fork 521
/
App.vue
90 lines (79 loc) · 1.63 KB
/
App.vue
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
85
86
87
88
89
90
<template>
<div>
<NavBar></NavBar>
<div class="content-app">
<transition name="fadeInUp" mode="out-in">
<router-view></router-view>
</transition>
<div class="footer">
<p>{{website.website_footer}} </p>
<p>Powered by <a href="https://github.com/QingdaoU/OnlineJudge">OnlineJudge</a>
<span v-if="version"> Version: {{ version }}</span>
</p>
</div>
</div>
<BackTop></BackTop>
</div>
</template>
<script>
import { mapActions, mapState } from 'vuex'
import NavBar from '@oj/components/NavBar.vue'
export default {
name: 'app',
components: {
NavBar
},
data () {
return {
version: process.env.VERSION
}
},
created () {
try {
document.body.removeChild(document.getElementById('app-loader'))
} catch (e) {
}
},
mounted () {
this.getWebsiteConfig()
},
methods: {
...mapActions(['getWebsiteConfig'])
},
computed: {
...mapState(['website'])
},
watch: {
'website' (newVal) {
document.title = newVal.website_name
}
}
}
</script>
<style lang="less">
* {
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
}
a {
text-decoration: none;
background-color: transparent;
&:active, &:hover {
outline-width: 0;
}
}
.content-app {
margin-top: 80px;
padding: 0 2%;
}
.footer {
margin-top: 20px;
margin-bottom: 10px;
text-align: center;
font-size: small;
}
.fadeInUp-enter-active {
animation: fadeInUp .8s;
}
</style>