mirror of
https://github.com/primefaces/primevue.git
synced 2025-05-09 00:42:36 +00:00
Update BaseComponent
This commit is contained in:
parent
6cd41325d1
commit
ea887fcea3
3 changed files with 13 additions and 2 deletions
|
@ -10,11 +10,16 @@ export default {
|
|||
}
|
||||
},
|
||||
methods: {
|
||||
getPTItem(obj = {}, key = '') {
|
||||
const fKey = ObjectUtils.convertToFlatCase(key);
|
||||
|
||||
return obj[Object.keys(obj).find((k) => ObjectUtils.convertToFlatCase(k) === fKey) || ''];
|
||||
},
|
||||
ptm(key = '', params = {}) {
|
||||
return ObjectUtils.getItemValue((this.pt || {})[key.toLowerCase()], { props: this.$props, state: this.$data, ...params });
|
||||
return ObjectUtils.getItemValue(this.getPTItem(this.pt, key), { props: this.$props, state: this.$data, ...params });
|
||||
},
|
||||
ptmo(obj = {}, key = '', params = {}) {
|
||||
return ObjectUtils.getItemValue(obj[key.toLowerCase()], params);
|
||||
return ObjectUtils.getItemValue(this.getPTItem(obj, key), params);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue