App.vue
1.23 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
<template>
<div id="app" :class="$route.meta.showTabBar ? 'tab-bar-page' : ''">
<template v-if="showWindow">
<transition name="fade">
<keep-alive>
<router-view v-if="$route.meta.keepAlive"></router-view>
</keep-alive>
</transition>
<transition name="fade">
<router-view v-if="!$route.meta.keepAlive"></router-view>
</transition>
<!-- 底部全局 TabBar -->
<TabBar v-if="$route.meta.showTabBar"></TabBar>
</template>
</div>
</template>
<script>
import TabBar from "@/components/tabBar/index.vue";
export default {
name: "App",
components: {
TabBar,
},
data() {
return {
showWindow: false,
tabBarRef: null,
};
},
computed: {
watchFlag() {
return this.$store.state.app.showWindow;
},
},
watch: {
watchFlag: {
immediate: true,
handler(newval) {
this.showWindow = newval;
this.hideLoading();
},
},
},
mounted() {},
methods: {},
};
</script>
<style lang="scss" scoped>
#app {
height: 100%;
width: 100%;
overflow: hidden;
box-sizing: border-box;
padding-bottom: calc(env(safe-area-inset-bottom));
background-color: white;
}
.tab-bar-page {
padding-bottom: calc(46px + (env(safe-area-inset-bottom))) !important;
}
</style>