DynamicInfo.vue 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. <template>
  2. <Card title="最新动态" v-bind="$attrs">
  3. <template #extra>
  4. <a-button type="link" size="small">更多</a-button>
  5. </template>
  6. <List item-layout="horizontal" :data-source="items">
  7. <template #renderItem="{ item }">
  8. <ListItem>
  9. <ListItemMeta>
  10. <template #description>
  11. {{ item.date }}
  12. </template>
  13. <template #title> {{ item.name }} <span v-html="item.desc"> </span> </template>
  14. <template #avatar>
  15. <Icon :icon="item.avatar" :size="30" />
  16. </template>
  17. </ListItemMeta>
  18. </ListItem>
  19. </template>
  20. </List>
  21. </Card>
  22. </template>
  23. <script lang="ts">
  24. import { defineComponent } from 'vue';
  25. import { Card, List } from 'ant-design-vue';
  26. import { dynamicInfoItems } from './data';
  27. import headerImg from '/@/assets/images/header.jpg';
  28. import { Icon } from '/@/components/Icon';
  29. export default defineComponent({
  30. components: { Card, List, ListItem: List.Item, ListItemMeta: List.Item.Meta, Icon },
  31. setup() {
  32. return { items: dynamicInfoItems, headerImg };
  33. },
  34. });
  35. </script>