zhengyiming
1 天以前 1327b99efda99ada27a956981648950f580314b0
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
<template>
  <div class="pro-list-item">
    <div class="pro-list-item-inner">
      <img v-if="icon" :src="icon" class="pro-list-item-icon" />
      <div class="pro-list-item-title">{{ title }}</div>
      <slot name="extra"></slot>
      <img v-if="showArrow" :src="IconArrow" class="pro-list-item-arrow" />
    </div>
  </div>
</template>
 
<script setup lang="ts">
import IconArrow from '@/assets/setting/icon-arrow.png';
 
defineOptions({
  name: 'ListItem',
});
 
type Props = {
  icon?: string;
  title?: string;
  showArrow?: boolean;
};
 
const props = withDefaults(defineProps<Props>(), {
  showArrow: true,
});
</script>
 
<style lang="scss">
@import '@/styles/common.scss';
 
.pro-list-item {
  padding: 0 boleGetCssVar('size', 'body-padding-h');
 
  .pro-list-item-inner {
    height: 102px;
    border-bottom: 1px solid #f6f6f6;
    display: flex;
    align-items: center;
 
    .pro-list-item-icon {
      width: 40px;
      height: 40px;
      margin-right: 16px;
    }
 
    .pro-list-item-title {
      font-weight: 400;
      font-size: 28px;
      color: boleGetCssVar('text-color', 'primary');
      line-height: 40px;
      flex: 1;
      min-width: 0;
      @include ellipsis;
    }
 
    .pro-list-item-arrow {
      width: 32px;
      height: 32px;
    }
  }
}
</style>