fix(auth): 登录页不再套 MainLayout(public 路由全屏裸渲染)
App.vue 按 route.meta.public 切换:登录页直接出 router-view,其余才带 侧栏布局 — 否则登录页嵌在侧栏旁边,布局错乱。 Co-Authored-By: Claude Code <noreply@anthropic.com>
This commit is contained in:
+9
-1
@@ -1,7 +1,15 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
|
import { computed } from 'vue'
|
||||||
|
import { useRoute } from 'vue-router'
|
||||||
import MainLayout from '@/layouts/MainLayout.vue'
|
import MainLayout from '@/layouts/MainLayout.vue'
|
||||||
|
|
||||||
|
// 登录页等 public 页面(meta.public)不套 MainLayout — 侧栏导航是登录后
|
||||||
|
// 才有的东西,登录页必须全屏裸渲染(router-view 直接出组件)。
|
||||||
|
const route = useRoute()
|
||||||
|
const isPublic = computed(() => route.meta.public === true)
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<MainLayout class="yk-app" />
|
<router-view v-if="isPublic" />
|
||||||
|
<MainLayout v-else class="yk-app" />
|
||||||
</template>
|
</template>
|
||||||
|
|||||||
Reference in New Issue
Block a user