|
| 1 | +<template> |
| 2 | + <List item-layout="vertical" :class="prefixCls"> |
| 3 | + <template v-for="(item, index) in list" :key="index"> |
| 4 | + <ListItem> |
| 5 | + <ListItemMeta> |
| 6 | + <template #description> |
| 7 | + <div :class="`${prefixCls}__content`">{{ item.content }}</div> |
| 8 | + </template> |
| 9 | + <template #title> |
| 10 | + <p :class="`${prefixCls}__title`"> {{ item.title }}</p> |
| 11 | + <div> |
| 12 | + <template v-for="(tag, index) in item.description" :key="index"> |
| 13 | + <Tag class="mb-2">{{ tag }}</Tag> |
| 14 | + </template> |
| 15 | + </div> |
| 16 | + </template> |
| 17 | + </ListItemMeta> |
| 18 | + <div> |
| 19 | + <template v-for="(action, index) in actions" :key="index"> |
| 20 | + <div :class="`${prefixCls}__action`"> |
| 21 | + <Icon |
| 22 | + v-if="action.icon" |
| 23 | + :class="`${prefixCls}__action-icon`" |
| 24 | + :icon="action.icon" |
| 25 | + :color="action.color" |
| 26 | + /> |
| 27 | + {{ action.text }} |
| 28 | + </div> |
| 29 | + </template> |
| 30 | + <span :class="`${prefixCls}__time`">{{ item.time }}</span> |
| 31 | + </div> |
| 32 | + </ListItem> |
| 33 | + </template> |
| 34 | + </List> |
| 35 | +</template> |
| 36 | +<script lang="ts"> |
| 37 | + import { defineComponent } from 'vue'; |
| 38 | + import { List, Tag } from 'ant-design-vue'; |
| 39 | + import Icon from '/@/components/Icon/index'; |
| 40 | + import { actions, articleList } from './data'; |
| 41 | +
|
| 42 | + export default defineComponent({ |
| 43 | + components: { |
| 44 | + List, |
| 45 | + ListItem: List.Item, |
| 46 | + ListItemMeta: List.Item.Meta, |
| 47 | + Tag, |
| 48 | + Icon, |
| 49 | + }, |
| 50 | + setup() { |
| 51 | + return { |
| 52 | + prefixCls: 'account-center-article', |
| 53 | + list: articleList, |
| 54 | + actions, |
| 55 | + }; |
| 56 | + }, |
| 57 | + }); |
| 58 | +</script> |
| 59 | +<style lang="less" scoped> |
| 60 | + .account-center-article { |
| 61 | + &__title { |
| 62 | + margin-bottom: 12px; |
| 63 | + font-size: 18px; |
| 64 | + } |
| 65 | +
|
| 66 | + &__content { |
| 67 | + color: rgba(0, 0, 0, 0.65); |
| 68 | + } |
| 69 | +
|
| 70 | + &__action { |
| 71 | + display: inline-block; |
| 72 | + padding: 0 16px; |
| 73 | + color: rgba(0, 0, 0, 0.45); |
| 74 | +
|
| 75 | + &:not(:last-child) { |
| 76 | + border-right: 1px solid rgba(206, 206, 206, 0.4); |
| 77 | + } |
| 78 | +
|
| 79 | + &-icon { |
| 80 | + margin-right: 3px; |
| 81 | + } |
| 82 | + } |
| 83 | +
|
| 84 | + &__time { |
| 85 | + position: absolute; |
| 86 | + right: 20px; |
| 87 | + color: rgba(0, 0, 0, 0.45); |
| 88 | + } |
| 89 | + } |
| 90 | +</style> |
0 commit comments