Project.vue 1.5 KB

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