mirror of
https://github.com/primefaces/primevue.git
synced 2025-05-10 09:22:34 +00:00
Theming API: Add unstyled
check to decide whether theme can be loaded or not
This commit is contained in:
parent
5700f617cd
commit
feaa8dd8a9
2 changed files with 8 additions and 0 deletions
|
@ -84,6 +84,8 @@ const BaseDirective = {
|
|||
ThemeService.on('theme:change', () => BaseDirective._loadThemeStyles(el.$instance, { nonce: config?.csp?.nonce }));
|
||||
},
|
||||
_loadThemeStyles: (instance = {}, useStyleOptions) => {
|
||||
if (instance?.isUnstyled()) return;
|
||||
|
||||
// common
|
||||
if (!Theme.isStyleNameLoaded('common')) {
|
||||
const { primitive, semantic, global } = instance.$style?.getCommonThemeCSS?.() || {};
|
||||
|
@ -181,6 +183,7 @@ const BaseDirective = {
|
|||
handleHook('beforeUpdate', el, binding, vnode, prevVnode);
|
||||
},
|
||||
updated: (el, binding, vnode, prevVnode) => {
|
||||
BaseDirective._loadStyles(el, binding, vnode);
|
||||
handleHook('updated', el, binding, vnode, prevVnode);
|
||||
},
|
||||
beforeUnmount: (el, binding, vnode, prevVnode) => {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue