From 42b887ae8552d08c79a8afa3bff13e6e1dbfa6d1 Mon Sep 17 00:00:00 2001 From: Mert Sincan Date: Fri, 20 Sep 2024 22:30:51 +0100 Subject: [PATCH] Update app-state.js --- apps/showcase/plugins/app-state.js | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/apps/showcase/plugins/app-state.js b/apps/showcase/plugins/app-state.js index 028373190..fc1813820 100644 --- a/apps/showcase/plugins/app-state.js +++ b/apps/showcase/plugins/app-state.js @@ -1,5 +1,3 @@ -import Material from '@primevue/themes/material'; -import PrimeVue from 'primevue/config'; import { reactive } from 'vue'; const $appState = { @@ -18,16 +16,21 @@ const $appState = { } }; -export default defineNuxtPlugin((nuxtApp) => { +export default defineNuxtPlugin(async (nuxtApp) => { const runtimeConfig = useRuntimeConfig(); nuxtApp.vueApp.use($appState); 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, { - theme: Material, - options: { - darkModeSelector: '.p-dark' + theme: { + preset: Material, + options: { + darkModeSelector: '.p-dark' + } } }); }