-
Notifications
You must be signed in to change notification settings - Fork 51
/
Copy pathApp.vue
95 lines (92 loc) · 2.25 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
91
92
93
94
95
<template lang="pug">
.app.u-clearfix
app-article-list
user
.app__content(
:class="{'app__content--Active': sideBar}",
v-finger:swipe="swipeRight",
@scroll="pushScrollData"
).l-page--Full
home-header
.app__bodyer.l-mH--auto.u-clearfix
transition(name="slideFade")
router-view
//- ,mode="out-in"
//- loading
include ./assets/svg/all
</template>
<script>
import store from './store'
import { mapGetters, mapActions } from 'vuex'
import Loading from './components/feedback/Loading.vue'
import HomeHeader from './components/templates/HomeHeader.vue'
import AppArticleList from './components/templates/AppArticleList.vue'
import User from 'src/components/templates/User.vue'
// import fullScreen from './utils/fullScreen'
export default {
data () {
return {
}
},
components: {
User,
Loading,
HomeHeader,
AppArticleList
},
computed: mapGetters([
'sideBar'
]),
methods: {
...mapActions([
'pushScrollData',
'sideBarSwitch'
]),
swipeRight: function (e) {
e.direction === 'Right' && !this.sideBar && this.sideBarSwitch()
e.direction === 'Left' && this.sideBar && this.sideBarSwitch()
}
}
}
window.onresize = function () {
store.dispatch('device')
}
</script>
<style lang="stylus">
@import './assets/stylus/main'
.app__menu
background-color c-master
.app__content
overflow auto
transition transform .5s
box-shadow 0 0 100px 5px rgba(0,0,0,0.3)
background-color c-bgc
transform-origin s-sideBar center
.app__content--Active
transform scale(.9) translateX(s-sideBar)
.app__bodyer
max-width max-width
background-color c-bgc
position relative
@media screen and (max-width: max-width)
.app__bodyer
padding 0 10px
margin-bottom 100px
.slideFade-enter-active,
.slideFade-leave-active
left 10px
.slideFade-enter-active,
.slideFade-leave-active
transition all .5s cb-duang
width 100%
position absolute
top 0
left 0
opacity 1
.slideFade-enter
transform translateX(100%)
opacity 0
.slideFade-leave-active
transform translateX(-100%)
opacity 0
</style>