chore: update nuxt to 3.10.3 (#2610)
This commit is contained in:
parent
1fefb6e5b6
commit
55037f04cd
53 changed files with 3584 additions and 3766 deletions
|
@ -56,7 +56,7 @@ export interface ThemeColors {
|
|||
}
|
||||
|
||||
export function getDefaultLanguage(languages: string[]) {
|
||||
if (process.server)
|
||||
if (import.meta.server)
|
||||
return 'en-US'
|
||||
return matchLanguages(languages, navigator.languages) || 'en-US'
|
||||
}
|
||||
|
|
|
@ -1,14 +1,12 @@
|
|||
import type { Ref } from 'vue'
|
||||
import type { VueI18n } from 'vue-i18n'
|
||||
import type { LocaleObject } from 'vue-i18n-routing'
|
||||
import type { LocaleObject } from '@nuxtjs/i18n'
|
||||
import type { FontSize, OldFontSize, PreferencesSettings, UserSettings } from './definition'
|
||||
import { STORAGE_KEY_SETTINGS } from '~/constants'
|
||||
import { oldFontSizeMap } from '~~/constants/options'
|
||||
|
||||
export function useUserSettings() {
|
||||
const i18n = useNuxtApp().vueApp.config.globalProperties.$i18n as VueI18n
|
||||
const { locales } = i18n
|
||||
const supportLanguages = (locales as LocaleObject[]).map(locale => locale.code)
|
||||
const { locales } = useNuxtApp().$i18n
|
||||
const supportLanguages = (unref(locales) as LocaleObject[]).map(locale => locale.code)
|
||||
const settingsStorage = useUserLocalStorage<UserSettings>(STORAGE_KEY_SETTINGS, () => getDefaultUserSettings(supportLanguages))
|
||||
|
||||
// Backward compatibility, font size was xs, sm, md, lg, xl before
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue