Files
2021-09-29 17:23:08 +08:00

117 lines
1.9 KiB
Vue

<template>
<router-view v-slot="{ Component }">
<div id="layout">
<Header/>
<keep-alive :include="includeList">
<component :is="Component"></component>
</keep-alive>
<Footer/>
</div>
</router-view>
</template>
<script lang="ts" setup>
import { Footer, Header } from '@/components'
import { ref, watch } from 'vue'
import { RouteLocationNormalizedLoaded, useRoute } from 'vue-router'
const includeList = ref<string[]>([])
const route = useRoute()
watch(route, (to: RouteLocationNormalizedLoaded) => {
if (to.meta?.keepAlive && includeList.value.indexOf(to.name as string) === -1) {
includeList.value.push(to.name as string)
}
})
</script>
<style lang="less">
* {
padding: 0;
margin: 0;
box-sizing: border-box;
}
body {
font-size: 14px;
background: #FAFAFA;
}
#layout {
.container {
width: 1200px;
margin: 0 auto;
min-height: calc(100vh - 164px);
}
}
.wrap {
width: 1200px;
margin: 0 auto;
}
a {
text-decoration: none;
color: #2055ca;
}
.inputTxt {
height: 250px;
overflow-y: auto;
width: 100%;
word-break: break-all;
padding: 16px;
background: #FFFFFF;
border-radius: 2px;
border: 2px solid rgba(235, 239, 241, 1);
font-size: 14px;
}
.assets {
background: #FFFFFF;
border: 1px solid #eee;
margin-top: 16px;
.title {
height: 60px;
line-height: 60px;
padding-left: 30px;
font-size: 16px;
font-weight: 500;
border-bottom: 1px solid #eee;
}
.info {
.left,
.right {
display: inline-block;
width: 50%;
padding: 20px 30px;
.item {
height: 60px;
line-height: 60px;
display: flex;
justify-content: left;
align-items: center;
img {
width: 16px;
height: 16px;
}
label {
width: 130px;
margin-left: 10px;
}
}
}
.left {
border-right: 1px solid #ececec;
}
}
}
</style>