2022-04-22 12:47:04 +08:00
|
|
|
|
<script lang="ts" setup>
|
2023-02-22 15:53:04 +08:00
|
|
|
|
import { useTagsViewStore } from "@/store/modules/tags-view"
|
2023-08-28 19:12:35 +08:00
|
|
|
|
// import { CompConsumer } from "./CompConsumer"
|
|
|
|
|
|
2023-02-22 15:53:04 +08:00
|
|
|
|
const tagsViewStore = useTagsViewStore()
|
2022-04-22 12:47:04 +08:00
|
|
|
|
</script>
|
|
|
|
|
|
2022-04-21 18:20:39 +08:00
|
|
|
|
<template>
|
|
|
|
|
<section class="app-main">
|
2023-06-05 11:19:27 +08:00
|
|
|
|
<div class="app-scrollbar">
|
2023-08-24 16:24:59 +08:00
|
|
|
|
<!-- key 采用 route.path 和 route.fullPath 有着不同的效果,大多数时候 path 更通用 -->
|
|
|
|
|
<router-view v-slot="{ Component, route }">
|
2023-06-05 11:19:27 +08:00
|
|
|
|
<transition name="el-fade-in" mode="out-in">
|
|
|
|
|
<keep-alive :include="tagsViewStore.cachedViews">
|
2023-08-24 16:24:59 +08:00
|
|
|
|
<component :is="Component" :key="route.path" />
|
2023-06-05 11:19:27 +08:00
|
|
|
|
</keep-alive>
|
2023-08-28 19:12:35 +08:00
|
|
|
|
<!-- <CompConsumer :component="Component" /> -->
|
2023-06-05 11:19:27 +08:00
|
|
|
|
</transition>
|
|
|
|
|
</router-view>
|
|
|
|
|
</div>
|
2023-08-18 09:11:48 +08:00
|
|
|
|
<!-- 返回顶部 -->
|
|
|
|
|
<el-backtop />
|
|
|
|
|
<!-- 返回顶部(固定 Header 情况下) -->
|
|
|
|
|
<el-backtop target=".app-scrollbar" />
|
2022-04-21 18:20:39 +08:00
|
|
|
|
</section>
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
<style lang="scss" scoped>
|
2023-06-05 11:19:27 +08:00
|
|
|
|
@import "@/styles/mixins.scss";
|
|
|
|
|
|
2022-04-21 18:20:39 +08:00
|
|
|
|
.app-main {
|
|
|
|
|
width: 100%;
|
2022-11-12 13:53:32 +08:00
|
|
|
|
background-color: var(--v3-body-bg-color);
|
2022-04-21 18:20:39 +08:00
|
|
|
|
}
|
|
|
|
|
|
2023-06-05 11:19:27 +08:00
|
|
|
|
.app-scrollbar {
|
|
|
|
|
height: 100%;
|
|
|
|
|
overflow: auto;
|
|
|
|
|
@include scrollbar;
|
|
|
|
|
}
|
2022-04-21 18:20:39 +08:00
|
|
|
|
</style>
|