diff --git a/app/composables/dark.ts b/app/composables/dark.ts index 0850ce8..a48e68b 100644 --- a/app/composables/dark.ts +++ b/app/composables/dark.ts @@ -3,7 +3,9 @@ * * @see https://vueuse.org/core/useDark/ */ -export const isDark = useDark() +export const isDark = useDark({ + storageKey: `color-scheme`, +}) /** * Toggle dark mode diff --git a/app/layouts/page.vue b/app/layouts/page.vue index 69a07d7..9ee09f4 100644 --- a/app/layouts/page.vue +++ b/app/layouts/page.vue @@ -5,6 +5,8 @@ const { toggleLocale } = useLocale() const route = useRoute() +const localePath = useLocalePath() + const { headerLogo } = storeToRefs(useLayoutStore()) function openGithub() { @@ -21,13 +23,13 @@ function openGithub() { v{{ APP_VERSION }}
- + {{ t('button.index-page') }} - + {{ t('button.about-page') }} - + {{ t('button.404-page') }} diff --git a/app/pages/index.vue b/app/pages/index.vue index f487807..30045fd 100644 --- a/app/pages/index.vue +++ b/app/pages/index.vue @@ -25,7 +25,7 @@ async function fetchData() { return loading.value = true try { - const res = await $fetch('/todos', { + const res = await $fetch('/todo', { baseURL: runtimeConfig.public.requestBaseUrl, }) todoList.value = res diff --git a/nuxt.config.ts b/nuxt.config.ts index 9dd20c6..d9436df 100644 --- a/nuxt.config.ts +++ b/nuxt.config.ts @@ -80,6 +80,9 @@ export default defineNuxtConfig({ // https://i18n.nuxtjs.org/ i18n: { defaultLocale: 'en', + // If you don't need the prefix strategy, you can remove the strategy option. + // And you can remove `useLocalePath` in `src` directory. + strategy: 'prefix_and_default', locales: [ { code: 'en', file: 'en.json', name: 'English' }, { code: 'zh', file: 'zh.json', name: '中文' }, diff --git a/server/api/todos.ts b/server/api/todo.ts similarity index 100% rename from server/api/todos.ts rename to server/api/todo.ts