// components/stat-card/index.js Component({ options: { addGlobalClass: true, }, properties: { title: { type: String, value: '', }, subTitle: { type: String, value: '', }, stats: { type: Array, value: [], }, loading: { type: Boolean, value: false, }, icon: { type: String, }, }, data: {}, methods: { handleClick(e) { const { index } = e.currentTarget.dataset; this.triggerEvent('cardClick', { index }); }, onSubTitleClick() { this.triggerEvent('subTitleClick'); } }, });