diff --git a/quasar.config.js b/quasar.config.js index 5ce46667c..dd7a91002 100644 --- a/quasar.config.js +++ b/quasar.config.js @@ -93,13 +93,11 @@ module.exports = configure(function (/* ctx */) { [ VueI18nPlugin({ runtimeOnly: false, + include: [ + path.resolve(__dirname, './src/i18n/locale/**'), + path.resolve(__dirname, './src/pages/**/locale/**'), + ], }), - { - // if you want to use Vue I18n Legacy API, you need to set `compositionOnly: false` - // compositionOnly: false, - // you need to set i18n resource including paths ! - include: path.resolve(__dirname, './src/i18n/**'), - }, ], ], }, diff --git a/src/boot/i18n.js b/src/boot/i18n.js index b23b6d5fd..ede8f5114 100644 --- a/src/boot/i18n.js +++ b/src/boot/i18n.js @@ -1,6 +1,7 @@ import { boot } from 'quasar/wrappers'; import { createI18n } from 'vue-i18n'; import messages from 'src/i18n'; +import { locales } from 'src/i18n/handle'; const i18n = createI18n({ locale: navigator.language || navigator.userLanguage, @@ -12,8 +13,9 @@ const i18n = createI18n({ legacy: false, }); -export default boot(({ app }) => { +export default boot(async ({ app }) => { // Set i18n instance on app + await locales(); app.use(i18n); }); diff --git a/src/components/ui/CardDescriptor.vue b/src/components/ui/CardDescriptor.vue index 8e9304d3e..f30ea8937 100644 --- a/src/components/ui/CardDescriptor.vue +++ b/src/components/ui/CardDescriptor.vue @@ -47,7 +47,7 @@ const arrayData = useArrayData($props.dataKey || $props.module, { skip: 0, }); const { store } = arrayData; -const entity = computed(() => store.data); +const entity = computed(() =>Array.isArray( store.data) ? store.data[0] : store.data); const isLoading = ref(false); defineExpose({ @@ -67,7 +67,7 @@ async function getData() { try { const { data } = await arrayData.fetch({ append: false, updateRouter: false }); state.set($props.dataKey, data); - emit('onFetch', data); + emit('onFetch', Array.isArray(data) ? data[0] : data); } finally { isLoading.value = false; } diff --git a/src/components/ui/CardSummary.vue b/src/components/ui/CardSummary.vue index 1e1480293..a06837cf4 100644 --- a/src/components/ui/CardSummary.vue +++ b/src/components/ui/CardSummary.vue @@ -32,7 +32,7 @@ const arrayData = useArrayData(props.dataKey || route.meta.moduleName, { skip: 0, }); const { store } = arrayData; -const entity = computed(() => store.data); +const entity = computed(() => Array.isArray(store.data) ? store.data[0] : store.data); const isLoading = ref(false); defineExpose({ diff --git a/src/components/ui/VnRow.vue b/src/components/ui/VnRow.vue index f2d2b55de..a2f89ff3f 100644 --- a/src/components/ui/VnRow.vue +++ b/src/components/ui/VnRow.vue @@ -1,17 +1,17 @@