Update BaseComponent

This commit is contained in:
mertsincan 2023-04-03 01:12:25 +01:00
parent 6cd41325d1
commit ea887fcea3
3 changed files with 13 additions and 2 deletions

View file

@ -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);
}
}
};