feat:#60 added switch button (not working)

This commit is contained in:
masterElmar
2023-11-15 04:10:47 +01:00
parent 3e1214d13b
commit 3f1a592468
11 changed files with 242 additions and 96 deletions

View File

@@ -1,45 +1,59 @@
<script lang="ts" setup>
import { ref } from "vue";
import { useI18n } from "vue-i18n";
const {t} = useI18n({})
import LocaleSwitcher from "./LocaleSwitcher.vue";
import i18n from "../i18n";
const { t, locale } = useI18n();
console.debug("locale", locale);
console.debug(useI18n().locale)
const items = ref([
{
label: t('createCalendar'),
label: t("createCalendar"),
icon: "pi pi-fw pi-plus",
url: "/",
url: `/${locale}`,
},
{
label: t('editCalendar'),
label: t("editCalendar"),
icon: "pi pi-fw pi-pencil",
url: "/edit",
url: `/${locale}/edit`,
},
{
label: t('roomFinder'),
label: t("roomFinder"),
icon: "pi pi-fw pi-calendar",
url: "/rooms",
url: `/${locale}/rooms`,
},
{
label: t('faq'),
label: t("faq"),
icon: "pi pi-fw pi-book",
url: "/faq",
url: `/${i18n.vueI18n.global.locale}/faq`,
},
{
label: t('imprint'),
label: t("imprint"),
icon: "pi pi-fw pi-id-card",
url: "/imprint",
url: `/${i18n.vueI18n.global.locale}/imprint`,
},
{
label: t('privacy'),
url: "/privacy-policy",
label: t("privacy"),
icon: "pi pi-fw pi-exclamation-triangle",
url: `/${i18n.vueI18n.global.locale}/privacy-policy`,
},
]);
function removeAllItems() {
items.value = [];
}
</script>
<template>
<Menubar :model="items" class="menubar justify-content-center">
<template #start></template>
<template #end>
<LocaleSwitcher></LocaleSwitcher>
<Button @click="removeAllItems()"></Button>
</template>
</Menubar>
</template>
@@ -48,4 +62,4 @@ const items = ref([
background-color: transparent;
border: none;
}
</style>
</style>