Refactor layout components and update theme configuration
This commit is contained in:
@@ -6,6 +6,7 @@ import Lara from '@primevue/themes/lara';
|
||||
import Nora from '@primevue/themes/nora';
|
||||
import { ref } from 'vue';
|
||||
|
||||
|
||||
const { layoutConfig, setPrimary, setSurface, setPreset, isDarkTheme } = useLayout();
|
||||
|
||||
const preset = ref(layoutConfig.preset);
|
||||
@@ -73,6 +74,8 @@ const surfaces = ref([
|
||||
}
|
||||
]);
|
||||
|
||||
|
||||
|
||||
function getPresetExt() {
|
||||
const color = primaryColors.value.find((c) => c.name === layoutConfig.primary);
|
||||
|
||||
@@ -203,6 +206,7 @@ function getPresetExt() {
|
||||
|
||||
function updateColors(type, color) {
|
||||
if (type === 'primary') {
|
||||
console.log("color", color);
|
||||
setPrimary(color.name);
|
||||
} else if (type === 'surface') {
|
||||
setSurface(color.name);
|
||||
@@ -220,6 +224,7 @@ function applyTheme(type, color) {
|
||||
}
|
||||
|
||||
function onPresetChange(value) {
|
||||
console.log("value", value);
|
||||
setPreset(value);
|
||||
const presetValue = presets[value];
|
||||
const surfacePalette = surfaces.value.find((s) => s.name === layoutConfig.surface)?.palette;
|
||||
|
||||
Reference in New Issue
Block a user