Update app-state.js

pull/6454/head
Mert Sincan 2024-09-20 22:30:51 +01:00
parent 4f3c43ec2c
commit 42b887ae85
1 changed files with 9 additions and 6 deletions

View File

@ -1,5 +1,3 @@
import Material from '@primevue/themes/material';
import PrimeVue from 'primevue/config';
import { reactive } from 'vue'; import { reactive } from 'vue';
const $appState = { const $appState = {
@ -18,17 +16,22 @@ const $appState = {
} }
}; };
export default defineNuxtPlugin((nuxtApp) => { export default defineNuxtPlugin(async (nuxtApp) => {
const runtimeConfig = useRuntimeConfig(); const runtimeConfig = useRuntimeConfig();
nuxtApp.vueApp.use($appState); nuxtApp.vueApp.use($appState);
if (runtimeConfig.public.DEV_ENV === 'hot') { if (runtimeConfig.public.DEV_ENV === 'hot') {
const { default: PrimeVue } = await import('primevue/config');
const { default: Material } = await import('@primevue/themes/material');
nuxtApp.vueApp.use(PrimeVue, { nuxtApp.vueApp.use(PrimeVue, {
theme: Material, theme: {
preset: Material,
options: { options: {
darkModeSelector: '.p-dark' darkModeSelector: '.p-dark'
} }
}
}); });
} }
}); });