layout.vue
974 Bytes
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
<template>
<el-container>
<!--<el-header id="app-header">
<Header @arrowTo="arrowTo"></Header>
</el-header>-->
<el-main id="app-main">
<router-view v-slot="{ Component }">
<component ref="childArrowPath" :is="Component "></component>
</router-view>
</el-main>
<el-footer id="app-footer" v-if="isShowFooter">
<Footer></Footer>
</el-footer>
<div v-show="false">{{ route.path }}</div>
</el-container>
</template>
<script setup lang="ts">
import router from "../router/index";
const route = useRoute();
let isShowFooter = ref(true)
let pathList = reactive(['/', '/product', '/mine'])
let childArrowPath = ref(null)
let arrowPath = ref("")
watchEffect(() => {
isShowFooter = false
if (pathList.includes(route.path)) {
isShowFooter = true
}
nextTick(() => {
arrowPath = childArrowPath.value.arrowPath
})
})
let arrowTo = () => {
router.push(arrowPath)
}
</script>
<style scoped>
</style>