mirror of
https://github.com/primefaces/primevue.git
synced 2025-05-08 16:37:15 +00:00
Refactor #4530
This commit is contained in:
parent
4ec4952b97
commit
877d6c07df
13 changed files with 22 additions and 30 deletions
|
@ -33,16 +33,20 @@ export default {
|
|||
classes,
|
||||
inlineStyles,
|
||||
loadStyle(options = {}) {
|
||||
return useStyle(this.css, { name: this.name, ...options });
|
||||
return this.css ? useStyle(this.css, { name: this.name, ...options }) : {};
|
||||
},
|
||||
getStyleSheet(extendedCSS = '', props = {}) {
|
||||
const _props = Object.entries(props)
|
||||
.reduce((acc, [k, v]) => acc.push(`${k}="${v}"`) && acc, [])
|
||||
.join(' ');
|
||||
if (this.css) {
|
||||
const _props = Object.entries(props)
|
||||
.reduce((acc, [k, v]) => acc.push(`${k}="${v}"`) && acc, [])
|
||||
.join(' ');
|
||||
|
||||
return `<style type="text/css" data-primevue-style-id="${this.name}" ${_props}>${this.css}${extendedCSS}</style>`;
|
||||
return `<style type="text/css" data-primevue-style-id="${this.name}" ${_props}>${this.css}${extendedCSS}</style>`;
|
||||
}
|
||||
|
||||
return '';
|
||||
},
|
||||
extend(style) {
|
||||
return { ...this, ...style };
|
||||
return { ...this, css: undefined, ...style };
|
||||
}
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue