کار اولیه
This commit is contained in:
+47
@@ -0,0 +1,47 @@
|
||||
<template>
|
||||
<UApp>
|
||||
<NuxtLayout>
|
||||
<NuxtPage />
|
||||
</NuxtLayout>
|
||||
<ConfirmModal />
|
||||
</UApp>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { onMounted, watch } from "vue";
|
||||
import { useHead } from "#imports";
|
||||
import { composSystemTheme } from "~/composables/composSystemTheme";
|
||||
import { getUserPermission } from "~/stores/permissionStore";
|
||||
|
||||
const userPermissionStore = getUserPermission();
|
||||
const systemTheme = composSystemTheme();
|
||||
const { applyTheme, logo, currentTheme, isRtl } = systemTheme;
|
||||
|
||||
// تنظیم اولیه در کلاینت
|
||||
onMounted(async () => {
|
||||
await applyTheme();
|
||||
userPermissionStore.fetchUserPermissions();
|
||||
});
|
||||
|
||||
// بهروزرسانی واکنشگرای عنوان و هدر
|
||||
watch(
|
||||
[logo, currentTheme, isRtl],
|
||||
([newLogo, newTheme, currentRtl]) => {
|
||||
useHead({
|
||||
title: `${newTheme?.title || "سامانه"} - ${newTheme?.subTitle || "مدیریت"}`,
|
||||
htmlAttrs: {
|
||||
dir: currentRtl ? "rtl" : "ltr",
|
||||
lang: currentRtl ? "fa" : "en",
|
||||
},
|
||||
link: [
|
||||
{
|
||||
rel: "icon",
|
||||
type: "image/x-icon",
|
||||
href: newLogo || "/favicon.ico",
|
||||
},
|
||||
],
|
||||
});
|
||||
},
|
||||
{ immediate: true }
|
||||
);
|
||||
</script>
|
||||
Reference in New Issue
Block a user