riku
2024-05-06 1534aee0339dee8000cdd26c21797cf3ad391f7a
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
<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="size != 'small'" class="ff-triangle">
      <div class="ff-triangle-border"></div>
    </div>
  </div>
</template>
 
<script>
// 统一样式卡片
export default {
  props: {
    /**
     * 样式折角大小
     * small | medium
     */
    size: {
      type: String,
      default: 'small'
    },
    /**
     * 样式朝向
     * left | right | top-left
     */
    direction: {
      type: String,
      default: 'left'
    },
    /**
     * 选择无边框方向
     * r(右侧无边框) | t(顶部无边框)
     */
    borderless: {
      type: String
    }
  },
  computed: {
    wrapClz() {
      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;
    }
  }
};
</script>