mirror of
https://github.com/primefaces/primevue.git
synced 2025-05-09 00:42:36 +00:00
Fixed #3902 - Add global pt option to PrimeVue config
This commit is contained in:
parent
2b40ff3dd2
commit
bd97a3e733
3 changed files with 19 additions and 3 deletions
|
@ -15,11 +15,18 @@ export default {
|
|||
|
||||
return obj[Object.keys(obj).find((k) => ObjectUtils.convertToFlatCase(k) === fKey) || ''];
|
||||
},
|
||||
getPTValue(obj = {}, key = '', params = {}) {
|
||||
const self = ObjectUtils.getItemValue(this.getPTItem(obj, key), params);
|
||||
const globalComponentPT = this.getPTItem(this.$primevue.config.pt, this.$.type.name);
|
||||
const global = ObjectUtils.getItemValue(this.getPTItem(globalComponentPT, key), params);
|
||||
|
||||
return { ...global, ...self };
|
||||
},
|
||||
ptm(key = '', params = {}) {
|
||||
return ObjectUtils.getItemValue(this.getPTItem(this.pt, key), { props: this.$props, state: this.$data, ...params });
|
||||
return this.getPTValue(this.pt, key, { props: this.$props, state: this.$data, ...params });
|
||||
},
|
||||
ptmo(obj = {}, key = '', params = {}) {
|
||||
return ObjectUtils.getItemValue(this.getPTItem(obj, key), params);
|
||||
return this.getPTValue(obj, key, params);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue