Refactor on nuxt module
parent
066e92aa03
commit
7425629e70
|
@ -132,16 +132,15 @@ export default {
|
||||||
return '';
|
return '';
|
||||||
},
|
},
|
||||||
getCommonStyleSheet({ name = '', theme = {}, params, props = {}, set, defaults }) {
|
getCommonStyleSheet({ name = '', theme = {}, params, props = {}, set, defaults }) {
|
||||||
const { primitive, semantic } = this.getCommon({ name, theme, params, set, defaults });
|
const common = this.getCommon({ name, theme, params, set, defaults });
|
||||||
const common_css = `${primitive.css}${semantic.css}`;
|
|
||||||
const _props = Object.entries(props)
|
const _props = Object.entries(props)
|
||||||
.reduce((acc, [k, v]) => acc.push(`${k}="${v}"`) && acc, [])
|
.reduce((acc, [k, v]) => acc.push(`${k}="${v}"`) && acc, [])
|
||||||
.join(' ');
|
.join(' ');
|
||||||
|
|
||||||
return Object.entries(common_css || {})
|
return Object.entries(common || {})
|
||||||
.reduce((acc, [key, value]) => {
|
.reduce((acc, [key, value]) => {
|
||||||
if (value) {
|
if (value?.css) {
|
||||||
const _css = SharedUtils.object.minifyCSS(value);
|
const _css = SharedUtils.object.minifyCSS(value?.css);
|
||||||
const id = `${key}-variables`;
|
const id = `${key}-variables`;
|
||||||
|
|
||||||
acc.push(`<style type="text/css" data-primevue-style-id="${id}" ${_props}>${_css}</style>`);
|
acc.push(`<style type="text/css" data-primevue-style-id="${id}" ${_props}>${_css}</style>`);
|
||||||
|
|
|
@ -22,11 +22,8 @@ export default defineNuxtConfig({
|
||||||
'/installation': { redirect: { to: '/vite', statusCode: 301 } }
|
'/installation': { redirect: { to: '/vite', statusCode: 301 } }
|
||||||
},
|
},
|
||||||
primevue: {
|
primevue: {
|
||||||
usePrimeVue: false,
|
usePrimeVue: true,
|
||||||
options: {
|
importTheme: { from: '@/themes/app-theme.js' },
|
||||||
ripple: true
|
|
||||||
},
|
|
||||||
//importTheme: { from: '@/themes/app-theme.js' },
|
|
||||||
resolvePath: function ({ as, from, type }) {
|
resolvePath: function ({ as, from, type }) {
|
||||||
const resolvedPath = from.replace('primevue', '@/components/lib');
|
const resolvedPath = from.replace('primevue', '@/components/lib');
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
import Noir from '@/themes/app-theme';
|
//import Noir from '@/themes/app-theme';
|
||||||
import PrimeVue from 'primevue/config';
|
//import PrimeVue from 'primevue/config';
|
||||||
import { reactive } from 'vue';
|
import { reactive } from 'vue';
|
||||||
|
|
||||||
const $appState = {
|
const $appState = {
|
||||||
|
@ -18,8 +18,7 @@ const $appState = {
|
||||||
|
|
||||||
export default defineNuxtPlugin((nuxtApp) => {
|
export default defineNuxtPlugin((nuxtApp) => {
|
||||||
nuxtApp.vueApp.use($appState);
|
nuxtApp.vueApp.use($appState);
|
||||||
nuxtApp.vueApp.use(PrimeVue, {
|
/*nuxtApp.vueApp.use(PrimeVue, {
|
||||||
|
|
||||||
theme: Noir
|
theme: Noir
|
||||||
});
|
});*/
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in New Issue