forked from mtianyan/vue-mooc
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathApp.vue
56 lines (56 loc) · 1.32 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
<template>
<div id="app" :style="getStyle">
<!-- content -->
<mooc-container>
<mooc-header height="72px">
<m-header />
</mooc-header>
<mooc-main>
<router-view />
</mooc-main>
<mooc-footer height="120px">
<m-footer />
</mooc-footer>
</mooc-container>
<!-- sidebar -->
<m-sidebar />
<!-- back to top -->
<mooc-backtop :show-height="500"></mooc-backtop>
<!-- login -->
<login v-if="showLogin" @maskClick="handleMaskClick" />
</div>
</template>
<script>
import MHeader from 'components/header/index.vue'
import MFooter from 'components/footer/footer.vue'
import MSidebar from 'components/sidebar/sidebar.vue'
import { mapGetters, mapMutations } from 'vuex'
import { scrollMixin } from 'assets/js/mixin.js'
export default {
name: 'App',
mixins: [scrollMixin],
computed: {
getStyle () {
return {
'max-height': this.showLogin ? '100%' : '',
'overflow': this.showLogin ? 'hidden' : ''
}
},
...mapGetters(['showLogin'])
},
methods: {
handleMaskClick () {
this.setShowLogin(!this.showLogin)
},
...mapMutations({
'setShowLogin': 'login/SET_SHOW_LOGIN'
})
},
components: {
MHeader,
MFooter,
MSidebar,
Login: () => import('components/login/index.vue')
}
}
</script>