mirror of
https://github.com/primefaces/primevue.git
synced 2025-05-09 00:42:36 +00:00
Theming API: update mergeKeys
method for presets
This commit is contained in:
parent
51110b585a
commit
9bdabd8530
4 changed files with 22 additions and 5 deletions
|
@ -49,6 +49,9 @@ export default {
|
|||
handler(newValue) {
|
||||
if (newValue) {
|
||||
this._loadScopedThemeStyles(newValue);
|
||||
this._themeChangeListener(() => this._loadScopedThemeStyles(newValue));
|
||||
} else {
|
||||
this._unloadScopedThemeStyles();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -91,7 +94,7 @@ export default {
|
|||
this._hook('onBeforeUnmount');
|
||||
},
|
||||
unmounted() {
|
||||
this.scopedStyleEl?.value?.remove();
|
||||
this._unloadScopedThemeStyles();
|
||||
this._hook('onUnmounted');
|
||||
},
|
||||
methods: {
|
||||
|
@ -185,6 +188,9 @@ export default {
|
|||
|
||||
this.scopedStyleEl = scopedStyle.el;
|
||||
},
|
||||
_unloadScopedThemeStyles() {
|
||||
this.scopedStyleEl?.value?.remove();
|
||||
},
|
||||
_themeChangeListener(callback = () => {}) {
|
||||
Base.clearLoadedStyleNames();
|
||||
ThemeService.on('theme:change', callback);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue