Files
rustdesk-api-web/src/layout/index.vue
T

74 lines
1.7 KiB
Vue
Raw Normal View History

2024-09-13 16:34:15 +08:00
<template>
2024-09-25 22:24:16 +08:00
<el-config-provider :locale="appStore.setting.locale">
<el-container>
<el-aside :width="leftWidth" class="app-left">
<g-aside></g-aside>
</el-aside>
<el-container class="app-container ">
<el-header class="app-header">
<g-header></g-header>
</el-header>
<div class="header-tags">
<tags></tags>
</div>
2024-09-13 16:34:15 +08:00
2024-09-25 22:24:16 +08:00
<el-main class="app-main">
<router-view v-slot="{ Component }">
<transition mode="out-in" name="el-fade-in-linear">
<keep-alive :include="[...cachedTags]">
<component :is="Component"/>
</keep-alive>
</transition>
</router-view>
</el-main>
</el-container>
2024-09-13 16:34:15 +08:00
</el-container>
2024-09-25 22:24:16 +08:00
</el-config-provider>
2024-09-13 16:34:15 +08:00
</template>
2024-09-25 22:24:16 +08:00
<script setup>
2024-09-13 16:34:15 +08:00
import { useUserStore } from '@/store/user'
import { useAppStore } from '@/store/app'
import { useTagsStore } from '@/store/tags'
2024-09-25 22:24:16 +08:00
import { ref, computed } from 'vue'
2024-09-13 16:34:15 +08:00
import Tags from '@/layout/components/tags/index.vue'
import GAside from '@/layout/components/aside.vue'
import GHeader from '@/layout/components/header.vue'
2024-09-25 22:24:16 +08:00
const appStore = useAppStore()
const tagStore = useTagsStore()
2024-09-13 16:34:15 +08:00
2024-09-25 22:24:16 +08:00
const leftWidth = computed(() => appStore.setting.sideIsCollapse ? '64px' : '210px')
2024-09-13 16:34:15 +08:00
2024-09-25 22:24:16 +08:00
const cachedTags = ref([])
2024-09-13 16:34:15 +08:00
2024-09-25 22:24:16 +08:00
cachedTags.value = tagStore.cached
2024-09-13 16:34:15 +08:00
</script>
<style lang="scss" scoped>
2024-09-25 22:24:16 +08:00
.app-header {
background-color: #3f454b;
color: var(--basicWhite);
display: flex;
height: 50px;
}
2024-09-13 16:34:15 +08:00
2024-09-25 22:24:16 +08:00
.header-tags {
height: auto;
border-bottom: 1px solid #eee;
display: flex;
padding: 0;
}
2024-09-13 16:34:15 +08:00
2024-09-25 22:24:16 +08:00
.app-left {
height: 100%;
transition: width 0.5s;
}
2024-09-13 16:34:15 +08:00
2024-09-25 22:24:16 +08:00
.app-container {
min-height: 100vh;
}
2024-09-13 16:34:15 +08:00
</style>