refactor: refs #7358 changed function to computed

This commit is contained in:
Jon Elias 2025-03-21 13:25:59 +01:00
parent a74ff042bc
commit d8b9f3467a
1 changed files with 6 additions and 6 deletions

View File

@ -1,5 +1,5 @@
<script setup> <script setup>
import { onMounted, ref } from 'vue'; import { onMounted, ref, computed } from 'vue';
import { useI18n } from 'vue-i18n'; import { useI18n } from 'vue-i18n';
import { useState } from 'src/composables/useState'; import { useState } from 'src/composables/useState';
import { useStateStore } from 'stores/useStateStore'; import { useStateStore } from 'stores/useStateStore';
@ -20,16 +20,16 @@ const appName = 'Lilium';
const pinnedModulesRef = ref(); const pinnedModulesRef = ref();
const env = process.env.NODE_ENV; const env = process.env.NODE_ENV;
function getEnvironment() { const getEnvironment = computed(() => {
switch (env) { switch (env) {
case 'development': case 'development':
return 'dev'; return 'DEV';
case 'production': case 'production':
return; return;
default: default:
return env; return env.toUpperCase();
} }
} });
onMounted(() => stateStore.setMounted()); onMounted(() => stateStore.setMounted());
const refresh = () => window.location.reload(); const refresh = () => window.location.reload();
</script> </script>
@ -62,7 +62,7 @@ const refresh = () => window.location.reload();
</QBtn> </QBtn>
</RouterLink> </RouterLink>
<QChip class="q-ml-xs q-mr-xs envChip"> <QChip class="q-ml-xs q-mr-xs envChip">
{{ getEnvironment() }} {{ getEnvironment }}
</QChip> </QChip>
<VnBreadcrumbs v-if="$q.screen.gt.sm" /> <VnBreadcrumbs v-if="$q.screen.gt.sm" />
<QSpinner <QSpinner