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
|
@ -61,6 +61,19 @@ export default {
|
|||
|
||||
return mergedObj;
|
||||
},
|
||||
mergeKeys(target = {}, source = {}) {
|
||||
const mergedObj = { ...target };
|
||||
|
||||
Object.keys(source).forEach((key) => {
|
||||
if (this.isObject(source[key]) && key in target && this.isObject(target[key])) {
|
||||
mergedObj[key] = this.mergeKeys(target[key], source[key]);
|
||||
} else {
|
||||
mergedObj[key] = source[key];
|
||||
}
|
||||
});
|
||||
|
||||
return mergedObj;
|
||||
},
|
||||
getItemValue(obj, ...params) {
|
||||
return this.isFunction(obj) ? obj(...params) : obj;
|
||||
},
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue