riku
2024-08-12 65124213af664a68ad88ce7f6dcb133116d7702f
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
// 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');
    }
  },
});