CustomLayout.vue 754 B

12345678910111213141516171819202122232425262728293031323334353637
  1. <script setup lang="ts">
  2. import { watchEffect } from "vue";
  3. import DefaultTheme from "vitepress/theme";
  4. import { useI18n } from "vue-i18n";
  5. import { useData } from "vitepress";
  6. import i18n from "@/plugins/i18n";
  7. const Layout = DefaultTheme.Layout;
  8. const { lang } = useData();
  9. const { t } = useI18n();
  10. watchEffect(() => {
  11. i18n.global.locale.value = lang.value;
  12. });
  13. </script>
  14. <template>
  15. <Layout>
  16. <template #nav-bar-content-before>
  17. <div class="content-before">{{ t("帮助中心") }}</div>
  18. </template>
  19. </Layout>
  20. </template>
  21. <i18n locale="zh-HK">
  22. {
  23. "帮助中心": "幫助中心"
  24. }
  25. </i18n>
  26. <style scoped>
  27. .content-before {
  28. color: #2e5aa8;
  29. font-size: 16px;
  30. font-weight: 600;
  31. line-height: 24px;
  32. margin-left: 14px;
  33. }
  34. </style>