mirror of
https://github.com/primefaces/primevue.git
synced 2025-05-09 00:42:36 +00:00
Fixed #4125 - Pass Through Props: Syntactic improvement suggestion
This commit is contained in:
parent
9cdbd621f1
commit
5f09ecd0a0
88 changed files with 110 additions and 88 deletions
|
@ -15,9 +15,15 @@ const BaseDirective = {
|
|||
: ObjectUtils.getItemValue(options, params);
|
||||
},
|
||||
_getPTValue: (instance = {}, obj = {}, key = '', params = {}, searchInDefaultPT = true) => {
|
||||
const getValue = (...args) => {
|
||||
const value = BaseDirective._getOptionValue(...args);
|
||||
|
||||
return ObjectUtils.isString(value) ? { class: value } : value;
|
||||
};
|
||||
|
||||
const datasetPrefix = 'data-pc-';
|
||||
const self = BaseDirective._getOptionValue(obj, key, params);
|
||||
const globalPT = searchInDefaultPT ? BaseDirective._getOptionValue(instance.defaultPT, key, params) : undefined;
|
||||
const self = getValue(obj, key, params);
|
||||
const globalPT = searchInDefaultPT ? getValue(instance.defaultPT, key, params) : undefined;
|
||||
const merged = mergeProps(self, globalPT, {
|
||||
...(key === 'root' && { [`${datasetPrefix}name`]: ObjectUtils.toFlatCase(instance.$name) }),
|
||||
[`${datasetPrefix}section`]: ObjectUtils.toFlatCase(key)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue