Riku
2025-03-02 de6fd089b37613808e5a3bef38ecc0761f7456e0
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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
<template>
  <div :class="wrapClz">
    <div class="ff-border-bottom"></div>
    <div class="ff-border-top">
      <div class="ff-border-content">
        <slot name="content"></slot>
      </div>
    </div>
    <div class="ff-footer">
      <slot name="footer"></slot>
    </div>
    <div v-if="type == 'content' && size == 'medium'" class="ff-triangle">
      <div class="ff-triangle-border"></div>
    </div>
  </div>
</template>
 
<script>
// 统一样式卡片
export default {
  props: {
    /**
     * 类型
     * content | btn
     */
    type: {
      type: String,
      default: 'content'
    },
    /**
     * 样式折角大小
     * small | medium | middle-s
     */
    size: {
      type: String,
      default: 'small'
    },
    /**
     * 样式朝向
     * content: left | right | top-left | down
     * btn: left | right | down
     */
    direction: {
      type: String,
      default: 'left'
    },
    /**
     * 选择无边框方向
     * r(右侧无边框) | t(顶部无边框)
     */
    borderless: {
      type: String
    }
  },
  computed: {
    wrapClz() {
      if (this.type == 'content') {
        let clz = 'ff-content p-events-auto';
        clz += ` ff-content-${this.direction}`;
        clz += ` ff-content-${this.size}`;
        clz += `${this.borderless ? '-borderless-' + this.borderless : ''}`;
        return clz;
      } else if (this.type == 'btn') {
        let clz = 'ff-toggle-btn p-events-auto';
        clz += ` ff-toggle-btn-${this.direction}`;
        clz += ` ff-btn-${this.size}`;
        return clz;
      } else {
        return '';
      }
    }
  }
};
</script>