mirror of
https://github.com/primefaces/primevue.git
synced 2025-05-08 16:37:15 +00:00
Fixed #4136 - Improve pt options on components that use helper component
This commit is contained in:
parent
ce96ce96b9
commit
d730a7081c
12 changed files with 52 additions and 18 deletions
|
@ -455,7 +455,7 @@ export default {
|
|||
|
||||
const datasetPrefix = 'data-pc-';
|
||||
const self = getValue(obj, key, params);
|
||||
const globalPT = searchInDefaultPT ? getValue(this.defaultPT, key, params) : undefined;
|
||||
const globalPT = searchInDefaultPT ? getValue(this.defaultPT, key, params) || (/./g.test(key) && !!params[key.split('.')[0]] ? getValue(this.globalPT, key, params) : undefined) : undefined;
|
||||
const merged = mergeProps(self, globalPT, {
|
||||
...(key === 'root' && { [`${datasetPrefix}name`]: ObjectUtils.toFlatCase(this.$.type.name) }),
|
||||
[`${datasetPrefix}section`]: ObjectUtils.toFlatCase(key)
|
||||
|
@ -489,8 +489,11 @@ export default {
|
|||
}
|
||||
},
|
||||
computed: {
|
||||
globalPT() {
|
||||
return ObjectUtils.getItemValue(this.$primevue.config.pt, { instance: this });
|
||||
},
|
||||
defaultPT() {
|
||||
return this._getOptionValue(this.$primevue.config.pt, this.$options.hostName || this.$.type.name, { instance: this });
|
||||
return this._getOptionValue(this.$primevue.config.pt, this.$options.hostName || this.$.type.name, { instance: this }) || this.globalPT;
|
||||
},
|
||||
isUnstyled() {
|
||||
return this.unstyled !== undefined ? this.unstyled : this.$primevue.config.unstyled;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue