Hanye官网
您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

1234567891011121314151617181920212223
  1. <template>
  2. <div>
  3. <RouteLoader />
  4. <NuxtLayout>
  5. <NuxtPage />
  6. </NuxtLayout>
  7. </div>
  8. </template>
  9. <script setup lang="ts">
  10. import { useI18n } from 'vue-i18n';
  11. const { locale } = useI18n();
  12. // 创建一个计算属性,用于 useHead
  13. // 它会根据当前 locale 动态生成 head 配置
  14. const head = computed(() => ({
  15. htmlAttrs: {
  16. // 将 html 标签的 lang 属性设置为当前的 locale code
  17. lang: locale.value,
  18. },
  19. }));
  20. useHead(head);
  21. </script>