/
Layout.vue
63 lines (59 loc) · 1.42 KB
/
Layout.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
<template>
<pro-layout
:routes="routes"
transition="el-fade-in"
>
<template #logo="{ collapse }">
<transition
name="el-zoom-in-top"
mode="out-in"
>
<img
v-if="collapse"
src="/logo.svg"
alt="logo"
class="logo-img"
>
<span
v-else
class="logo-title"
> element-pro-components </span>
</transition>
</template>
<template #header-left>
<pro-breadcrumb />
</template>
<template #header-right>
<nav-header />
</template>
<template #header-bottom>
<pro-tabs ref="tabs" />
</template>
</pro-layout>
<pwa-popup />
</template>
<script setup lang="ts">
import { computed, provide, shallowRef } from 'vue'
import { useRouter } from 'vue-router'
import { useLang } from '../composables/index'
import NavHeader from '../components/NavHeader.vue'
import PwaPopup from '../components/PwaPopup.vue'
const router = useRouter()
const lang = useLang()
const tabs = shallowRef({})
const routes = computed(() => {
const reg = new RegExp(`^\\/(${lang.value}|dev)\\/`)
const routes = router.options.routes
return routes.filter((item) => reg.test(item.path))
})
provide('tabs', tabs)
</script>
<style scoped>
.logo-img {
padding: 7px 10px;
width: calc(var(--pro-layout-width-aside-collapse) - 20px);
}
.logo-title {
line-height: var(--pro-layout-height-header);
}
</style>