Ben Lin
2025-03-08 858b9bccead46cdefc99325b7c956d50a2964309
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
75
76
77
78
79
80
81
82
83
84
<template>
  <List item-layout="vertical" :class="prefixCls">
    <template v-for="item in articleList" :key="item.title">
      <ListItem>
        <ListItemMeta>
          <template #description>
            <div :class="`${prefixCls}__content`">
              {{ item.content }}
            </div>
          </template>
          <template #title>
            <p :class="`${prefixCls}__title`">
              {{ item.title }}
            </p>
            <div>
              <template v-for="tag in item.description" :key="tag">
                <Tag class="mb-2">
                  {{ tag }}
                </Tag>
              </template>
            </div>
          </template>
        </ListItemMeta>
        <div>
          <template v-for="action in actions" :key="action.text">
            <div :class="`${prefixCls}__action`">
              <Icon
                v-if="action.icon"
                :class="`${prefixCls}__action-icon`"
                :icon="action.icon"
                :color="action.color"
              />
              {{ action.text }}
            </div>
          </template>
          <span :class="`${prefixCls}__time`">{{ item.time }}</span>
        </div>
      </ListItem>
    </template>
  </List>
</template>
<script lang="ts" setup>
  import { List, Tag } from 'ant-design-vue';
  import Icon from '@/components/Icon/Icon.vue';
  import { actions, articleList } from './data';
 
  const ListItem = List.Item;
  const ListItemMeta = List.Item.Meta;
 
  const prefixCls = 'account-center-article';
</script>
<style lang="less" scoped>
  .account-center-article {
    &__title {
      margin-bottom: 12px;
      font-size: 18px;
    }
 
    &__content {
      color: @text-color-secondary;
    }
 
    &__action {
      display: inline-block;
      padding: 0 16px;
      color: @text-color-secondary;
 
      &:nth-child(1),
      &:nth-child(2) {
        border-right: 1px solid rgb(206 206 206 / 40%);
      }
 
      &-icon {
        margin-right: 3px;
      }
    }
 
    &__time {
      position: absolute;
      right: 20px;
      color: rgb(0 0 0 / 45%);
    }
  }
</style>