2026-08-01 16:27:22 +08:00
|
|
|
<script setup lang="ts">
|
2026-09-03 15:26:48 +08:00
|
|
|
import { computed } from 'vue'
|
|
|
|
|
import { useRoute } from 'vue-router'
|
2026-08-01 16:27:22 +08:00
|
|
|
import MainLayout from '@/layouts/MainLayout.vue'
|
2026-09-03 15:26:48 +08:00
|
|
|
|
|
|
|
|
// 登录页等 public 页面(meta.public)不套 MainLayout — 侧栏导航是登录后
|
|
|
|
|
// 才有的东西,登录页必须全屏裸渲染(router-view 直接出组件)。
|
|
|
|
|
const route = useRoute()
|
|
|
|
|
const isPublic = computed(() => route.meta.public === true)
|
2026-08-01 16:27:22 +08:00
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
<template>
|
2026-09-03 15:26:48 +08:00
|
|
|
<router-view v-if="isPublic" />
|
|
|
|
|
<MainLayout v-else class="yk-app" />
|
2026-08-01 16:27:22 +08:00
|
|
|
</template>
|