App.vue
1.5 KB
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
<template>
<div id="app">
<template v-if="showWindow">
<transition name="fade">
<keep-alive v-if="$route.meta.keepAlive">
<router-view></router-view>
</keep-alive>
</transition>
<transition name="fade">
<router-view v-if="!$route.meta.keepAlive"></router-view>
</transition>
<template v-if="$route.meta.isTab && entry != 'normal'">
<tab-bar :data="tabList"></tab-bar>
</template>
</template>
</div>
</template>
<script>
const IS_PROD = ['production', 'prod'].includes(process.env.NODE_ENV)
export default {
name: 'App',
data() {
return {
entry: IS_PROD ? 'normal' :'chat_attachment',
tabList: [
{
title: '卡券',
name: 'coupon',
active: require('@/assets/images/tabbar/coupon_active.png'),
inactive: require('@/assets/images/tabbar/coupon.png')
},
{
title: '活动',
name: 'activity',
active: require('@/assets/images/tabbar/activity_active.png'),
inactive: require('@/assets/images/tabbar/activity.png')
}
]
}
},
watch: {
watchFlag: {
immediate: true,
handler(newval) {
this.showWindow = newval
this.hideLoading()
}
}
},
computed: {
watchFlag() {
return this.$store.state.app.showWindow
}
},
mounted() {
},
methods: {}
}
</script>
<style lang="scss" scoped>
.isTab {
padding-bottom: 50px;
box-sizing: border-box;
}
</style>