0
0
Fork 0

Updated sintax

This commit is contained in:
Joan Sanchez 2023-01-03 15:00:50 +01:00
parent bb0108095b
commit b7efd1ebf4
2 changed files with 42 additions and 16 deletions

View File

@ -25,12 +25,12 @@ const userLocale = computed({
// FIXME: Dynamic imports from absolute paths are not compatible with vite:
// https://github.com/rollup/plugins/tree/master/packages/dynamic-import-vars#limitations
try {
const langList = import.meta.glob('../../node_modules/quasar/lang/*.mjs')
langList[`../../node_modules/quasar/lang/${value}.mjs`]().then(lang => {
Quasar.lang.set(lang.default)
})
const langList = import.meta.glob('../../node_modules/quasar/lang/*.mjs');
langList[`../../node_modules/quasar/lang/${value}.mjs`]().then((lang) => {
Quasar.lang.set(lang.default);
});
} catch (error) {
//
}
},
});
@ -88,19 +88,33 @@ function logout() {
<div class="row no-wrap q-pa-md">
<div class="column panel">
<div class="text-h6 q-mb-md">{{ t('components.userPanel.settings') }}</div>
<q-toggle v-model="userLocale" @update:model-value="saveLanguage"
:label="t(`globals.lang['${userLocale}']`)" icon="public" color="orange" false-value="es"
true-value="en" />
<q-toggle v-model="darkMode" @update:model-value="saveDarkMode" :label="t(`globals.darkMode`)"
checked-icon="dark_mode" color="orange" unchecked-icon="light_mode" />
<q-toggle
v-model="userLocale"
@update:model-value="saveLanguage"
:label="t(`globals.lang['${userLocale}']`)"
icon="public"
color="orange"
false-value="es"
true-value="en"
/>
<q-toggle
v-model="darkMode"
@update:model-value="saveDarkMode"
:label="t(`globals.darkMode`)"
checked-icon="dark_mode"
color="orange"
unchecked-icon="light_mode"
/>
</div>
<q-separator vertical inset class="q-mx-lg" />
<div class="column items-center panel">
<q-avatar size="80px">
<q-img :src="`/api/Images/user/160x160/${user.id}/download?access_token=${token}`"
spinner-color="white" />
<q-img
:src="`/api/Images/user/160x160/${user.id}/download?access_token=${token}`"
spinner-color="white"
/>
</q-avatar>
<div class="text-subtitle1 q-mt-md">
@ -108,8 +122,16 @@ function logout() {
</div>
<div class="text-subtitle3 text-grey-7 q-mb-xs">@{{ user.name }}</div>
<q-btn id="logout" color="orange" flat :label="t('globals.logOut')" size="sm" icon="logout"
@click="logout()" v-close-popup />
<q-btn
id="logout"
color="orange"
flat
:label="t('globals.logOut')"
size="sm"
icon="logout"
@click="logout()"
v-close-popup
/>
</div>
</div>
</q-menu>

View File

@ -28,7 +28,9 @@ const userLocale = computed({
langList[`../../node_modules/quasar/lang/${value}.mjs`]().then((lang) => {
Quasar.lang.set(lang.default);
});
} catch (error) {}
} catch (error) {
//
}
},
});
@ -67,7 +69,9 @@ async function onSubmit() {
} else {
router.push({ name: 'Dashboard' });
}
} catch (error) {}
} catch (error) {
//
}
}
</script>