Article.vue 2.3 KB

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