UNPKG

primevue

Version:

[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT) [![npm version](https://badge.fury.io/js/primevue.svg)](https://badge.fury.io/js/primevue) [![Discord Chat](https://img.shields.io/discord/55794023

2 lines (1 loc) 751 B
import{ObjectUtils as t}from"primevue/utils";import{mergeProps as e}from"vue";var s={name:"BaseComponent",props:{pt:{type:Object,default:void 0}},methods:{getOption(e={},s=""){const a=t.convertToFlatCase(s);return e[Object.keys(e).find((e=>t.convertToFlatCase(e)===a))||""]},getPTValue(s={},a="",r={}){const i=t.getItemValue(this.getOption(s,a),r),o=t.getItemValue(this.getOption(this.defaultPT,a),r);return e(i,o)},ptm(t="",e={}){return this.getPTValue(this.pt,t,{props:this.$props,state:this.$data,...e})},ptmo(t={},e="",s={}){return this.getPTValue(t,e,s)}},computed:{defaultPT(){return t.getItemValue(this.getOption(this.$primevue.config.pt,this.$.type.name),this.defaultsParams)},defaultsParams(){return{instance:this.$}}}};export{s as default};