Project.vue 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. <template>
  2. <List :class="prefixCls">
  3. <a-row :gutter="16">
  4. <template v-for="(item, index) in list" :key="index">
  5. <a-col :span="6">
  6. <ListItem>
  7. <Card :hoverable="true" :class="`${prefixCls}__card`">
  8. <img :src="demoImg" />
  9. <div :class="`${prefixCls}__card-title`">
  10. {{ item.title }}
  11. </div>
  12. <div :class="`${prefixCls}__card-content`"> {{ item.content }}</div>
  13. </Card>
  14. </ListItem>
  15. </a-col>
  16. </template>
  17. </a-row>
  18. </List>
  19. </template>
  20. <script lang="ts">
  21. import { defineComponent } from 'vue';
  22. import { List, Card, Row, Col } from 'ant-design-vue';
  23. import demoImg from '/@/assets/images/demo.png';
  24. import { projectList } from './data';
  25. export default defineComponent({
  26. components: {
  27. List,
  28. ListItem: List.Item,
  29. Card,
  30. [Row.name]: Row,
  31. [Col.name]: Col,
  32. },
  33. setup() {
  34. return {
  35. prefixCls: 'account-center-project',
  36. list: projectList,
  37. demoImg,
  38. };
  39. },
  40. });
  41. </script>
  42. <style lang="less">
  43. .account-center-project {
  44. &__card {
  45. width: 100%;
  46. .ant-card-body {
  47. padding: 0 0 24px 0;
  48. }
  49. img {
  50. width: 100%;
  51. height: 130px;
  52. }
  53. &-title {
  54. margin: 5px 10px;
  55. font-size: 16px;
  56. font-weight: 500;
  57. color: rgba(0, 0, 0, 0.85);
  58. }
  59. &-content {
  60. margin: 5px 10px;
  61. }
  62. }
  63. }
  64. </style>