+
+
-
-
-
+
-
@@ -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
diff --git a/client/src/components/Header.vue b/client/src/components/Header.vue
index eaecf53..ecbc4ff 100644
--- a/client/src/components/Header.vue
+++ b/client/src/components/Header.vue
@@ -62,9 +62,9 @@
@@ -85,6 +85,7 @@
import { ref, onMounted, onUpdated, watch, nextTick } from 'vue'
import { useRouter, useRoute } from 'vue-router'
import { getPublicSettings } from '../services/api'
+import Icon from './Icon.vue'
const router = useRouter()
const route = useRoute()
@@ -122,11 +123,7 @@ const updateActiveNav = () => {
else if (path === '/about') activeNav.value = 'about'
}
-const refreshIcons = () => {
- if ((window as any).lucide) {
- (window as any).lucide.createIcons()
- }
-}
+// Icons are now handled by Vue components
// 获取网站配置
const loadSiteSettings = async () => {
@@ -157,19 +154,13 @@ const loadSiteSettings = async () => {
onMounted(() => {
updateActiveNav()
- refreshIcons()
loadSiteSettings()
})
-onUpdated(() => {
- refreshIcons()
-})
-
watch(
() => route.path,
() => {
updateActiveNav()
- nextTick(refreshIcons)
}
)
diff --git a/client/src/components/Icon.vue b/client/src/components/Icon.vue
index 9a0e5d7..fb9eaf6 100644
--- a/client/src/components/Icon.vue
+++ b/client/src/components/Icon.vue
@@ -1,40 +1,38 @@
-
+ :size="size"
+ />
\ No newline at end of file
diff --git a/client/src/main.ts b/client/src/main.ts
index 74be169..6f72d88 100644
--- a/client/src/main.ts
+++ b/client/src/main.ts
@@ -4,6 +4,21 @@ import "./style.css"
import "highlight.js/styles/atom-one-dark.css"
import router from "./router"
+// 导入字体
+import "@fontsource/inter/300.css"
+import "@fontsource/inter/400.css"
+import "@fontsource/inter/500.css"
+import "@fontsource/inter/600.css"
+import "@fontsource/noto-sans-sc/300.css"
+import "@fontsource/noto-sans-sc/400.css"
+import "@fontsource/noto-sans-sc/500.css"
+import "@fontsource/noto-sans-sc/700.css"
+import "@fontsource/playfair-display/400.css"
+import "@fontsource/playfair-display/400-italic.css"
+import "@fontsource/playfair-display/600.css"
+import "@fontsource/playfair-display/700.css"
+import "@fontsource/jetbrains-mono/400.css"
+
const app = createApp(App)
app.use(router)
app.mount("#app")
\ No newline at end of file
diff --git a/client/src/pages/BlogDetail.vue b/client/src/pages/BlogDetail.vue
index af7d447..df6a9bb 100644
--- a/client/src/pages/BlogDetail.vue
+++ b/client/src/pages/BlogDetail.vue
@@ -1,12 +1,12 @@
-
-
+
+
@@ -26,19 +26,86 @@
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
{{ post.categoryName || '未分类' }}
{{ post.date }}
-
{{ post.title }}
+
{{ post.title }}
-
-
-
@@ -108,6 +108,7 @@
import { ref, onMounted } from 'vue'
import { fetchWorks, fetchPosts, Work, Post } from '../services/api'
import { useScrollAnimation } from '../composables/useScrollAnimation'
+import Icon from '../components/Icon.vue'
const { initObserver } = useScrollAnimation()
diff --git a/client/src/pages/WorkDetail.vue b/client/src/pages/WorkDetail.vue
index b859e86..0f01f85 100644
--- a/client/src/pages/WorkDetail.vue
+++ b/client/src/pages/WorkDetail.vue
@@ -1,7 +1,7 @@
@@ -34,7 +34,7 @@
@@ -77,10 +77,10 @@
class="group flex items-center justify-between w-full py-4 border-t border-white/10 hover:bg-white/5 transition-colors"
>
-
+
访问线上项目
-
+
-
+
查看演示
-
+
-
+
查看源码
-
+
@@ -152,6 +152,7 @@ import { ref, onMounted, onBeforeUnmount, watch } from 'vue'
import { useRoute, useRouter } from 'vue-router'
import { fetchWork, Work } from '../services/api'
import { useScrollAnimation } from '../composables/useScrollAnimation'
+import Icon from '../components/Icon.vue'
const route = useRoute()
const router = useRouter()
@@ -226,10 +227,7 @@ watch(() => route.params.id, (newId) => {
onMounted(() => {
fetchWorkDetails()
- // 初始化Lucide图标
- if (window.lucide) {
- window.lucide.createIcons()
- }
+ // Icons are now handled by Vue components
// 添加滚动事件监听
window.addEventListener('scroll', updateScrollProgress)
})
diff --git a/client/src/pages/Works.vue b/client/src/pages/Works.vue
index e43cb6b..3d46c0e 100644
--- a/client/src/pages/Works.vue
+++ b/client/src/pages/Works.vue
@@ -77,7 +77,7 @@
@click.stop
class="inline-flex items-center gap-2 px-4 py-2 border border-white/10 rounded-full text-xs text-white/70 hover:border-art-accent hover:text-art-accent transition-all"
>
-
+
线上项目
-
+
演示
-
+
源码
- 查看项目详情
+ 查看项目详情
@@ -118,6 +118,7 @@
import { ref, onMounted } from 'vue'
import { fetchWorks, Work } from '../services/api'
import { useScrollAnimation } from '../composables/useScrollAnimation'
+import Icon from '../components/Icon.vue'
const works = ref
([])
const loading = ref(false)
@@ -142,9 +143,6 @@ const fetchWorksData = async () => {
onMounted(() => {
fetchWorksData()
- // 初始化Lucide图标
- if (window.lucide) {
- window.lucide.createIcons()
- }
+ // Icons are now handled by Vue components
})
\ No newline at end of file