Hanye官网
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

app.vue 459B

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