From cead32f93d9194918d1c358b1cd9ba51b2e718b7 Mon Sep 17 00:00:00 2001 From: huanshuo-W <15258427350@163.com> Date: Sat, 12 Jul 2025 15:21:22 +0800 Subject: [PATCH] =?UTF-8?q?Feature:=20=E4=B8=BA=E7=BD=91=E9=A1=B5=E6=A0=87?= =?UTF-8?q?=E9=A2=98=E6=B7=BB=E5=8A=A0=E5=9B=BD=E9=99=85=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- index.html | 2 +- src/App.vue | 13 +++++++++++++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/index.html b/index.html index 8abc79c..4fd70d3 100644 --- a/index.html +++ b/index.html @@ -4,7 +4,7 @@ - Welcome to Vuetify 3 + Loading...
diff --git a/src/App.vue b/src/App.vue index b821554..bf36424 100644 --- a/src/App.vue +++ b/src/App.vue @@ -83,6 +83,11 @@ const selectedIndex = ref(0) const windowWidth = ref(typeof window === 'undefined' ? 1200 : window.innerWidth) + // 动态设置网页标题 + const pageTitle = computed(() => { + return t('appTitle') + }) + // 监听窗口变化 const handleResize = () => { if (typeof window === 'undefined') return @@ -195,4 +200,12 @@ selectedIndex.value = index drawer.value = false // 选择后自动关闭抽屉 } + + onMounted(() => { + document.title = pageTitle.value + }) + + watch(locale, () => { + document.title = pageTitle.value + })