diff --git a/docs/.vuepress/config.ts b/docs/.vuepress/config.ts index cca1e773d..fec94b539 100644 --- a/docs/.vuepress/config.ts +++ b/docs/.vuepress/config.ts @@ -23,7 +23,6 @@ export default defineUserConfig({ editLinks: true, editLinkText: "帮助我们改善此页面!", enableToggle: true, - ToggleText: "切换主题", navbar: [ { text: "首页", link: "/" }, { text: "大史记", link: "/about/news.md" }, @@ -159,6 +158,11 @@ export default defineUserConfig({ themePlugins: { git: process.env.NODE_ENV === "production", }, + locales: { + "/": { + ToggleText: "切换主题", + }, + }, }, markdown: { toc: { diff --git a/docs/.vuepress/theme/components/ThemeToggle.vue b/docs/.vuepress/theme/components/ThemeToggle.vue index 31ed317b4..732167b2a 100644 --- a/docs/.vuepress/theme/components/ThemeToggle.vue +++ b/docs/.vuepress/theme/components/ThemeToggle.vue @@ -10,8 +10,8 @@ - - diff --git a/docs/.vuepress/theme/types/index.ts b/docs/.vuepress/theme/types/index.ts new file mode 100644 index 000000000..934fd7345 --- /dev/null +++ b/docs/.vuepress/theme/types/index.ts @@ -0,0 +1 @@ +export * from "./toggle"; diff --git a/docs/.vuepress/theme/types/toggle.ts b/docs/.vuepress/theme/types/toggle.ts new file mode 100644 index 000000000..ecfadae95 --- /dev/null +++ b/docs/.vuepress/theme/types/toggle.ts @@ -0,0 +1,4 @@ +export interface ToggleOptions { + enableToggle?: boolean; + ToggleText?: string; +}