数据结构优化
This commit is contained in:
@@ -1,25 +1,28 @@
|
||||
<template>
|
||||
<div class="min-h-screen bg-art-bg text-art-text relative overflow-hidden">
|
||||
<!--
|
||||
CRITICAL FIX: Removed 'overflow-hidden' from this root div.
|
||||
'overflow-hidden' on an ancestor element breaks 'position: sticky'
|
||||
in child components (like BlogDetail TOC) because it changes the
|
||||
scrolling context.
|
||||
-->
|
||||
<div class="min-h-screen bg-art-bg text-art-text relative">
|
||||
<!-- Star Background (Only for frontend) -->
|
||||
<!-- Removed the gradient background div to keep original theme color -->
|
||||
<StarBackground v-if="!isAdminOrLogin" class="z-0" />
|
||||
|
||||
<!-- Global Noise (Only for frontend) -->
|
||||
<!-- z-index 提高到 60 保持在最上层 -->
|
||||
<div v-if="!isAdminOrLogin" class="fixed inset-0 pointer-events-none z-[60] bg-noise opacity-30 mix-blend-overlay"></div>
|
||||
|
||||
<!-- Toast Container -->
|
||||
<div id="toast-container" class="toast-container relative z-[70]"></div>
|
||||
|
||||
<!-- Header (Hide on Admin & Login) -->
|
||||
<Header v-if="!isAdminOrLogin" class="z-50" />
|
||||
<Header v-if="!isAdminOrLogin" class="relative z-50" />
|
||||
|
||||
<!-- Mobile Menu (Hide on Admin & Login) -->
|
||||
<MobileMenu v-if="!isAdminOrLogin" class="relative z-50" />
|
||||
|
||||
<!-- Main Content -->
|
||||
<!-- Conditional classes: Apply max-w-7xl only for frontend pages -->
|
||||
<!-- 添加 relative z-10 确保内容浮在星星之上 -->
|
||||
<main :class="[
|
||||
isAdminOrLogin ? 'w-full h-full' : 'pt-32 pb-20 px-6 max-w-7xl mx-auto relative z-10'
|
||||
]">
|
||||
@@ -44,7 +47,7 @@ import Header from './components/Header.vue'
|
||||
import MobileMenu from './components/MobileMenu.vue'
|
||||
import Footer from './components/Footer.vue'
|
||||
import InquiryModal from './components/InquiryModal.vue'
|
||||
import StarBackground from './components/StarBackground.vue' // Import the new component
|
||||
import StarBackground from './components/StarBackground.vue'
|
||||
import { getPublicSettings } from './services/api'
|
||||
|
||||
const route = useRoute()
|
||||
@@ -55,11 +58,16 @@ const isAdminOrLogin = computed(() => {
|
||||
return path.startsWith('/admin') || path === '/login'
|
||||
})
|
||||
|
||||
// 应用网站配置到meta标签(页面标题由路由守卫处理)
|
||||
// 应用网站配置到页面标题和meta标签
|
||||
const applySiteSettings = async () => {
|
||||
try {
|
||||
const settings = await getPublicSettings()
|
||||
|
||||
// 设置页面标题
|
||||
if (settings.site_title) {
|
||||
document.title = settings.site_title
|
||||
}
|
||||
|
||||
// 更新meta标签
|
||||
const updateMetaTag = (name: string, content: string) => {
|
||||
if (!content) return
|
||||
|
||||
Reference in New Issue
Block a user