17ca04fc799195fe73b1a7444fd0f1d1c5d29dd0.svn-base 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109
  1. <template>
  2. <div class="card-list" ref="content">
  3. <a-list
  4. :grid="{gutter: 24, lg: 3, md: 2, sm: 1, xs: 1}"
  5. :dataSource="dataSource"
  6. >
  7. <a-list-item slot="renderItem" slot-scope="item, index">
  8. <template v-if="index === 0">
  9. <a-button class="new-btn" type="dashed">
  10. <a-icon type="plus"/>
  11. 新增产品
  12. </a-button>
  13. </template>
  14. <template v-else>
  15. <a-card :hoverable="true">
  16. <a-card-meta>
  17. <div style="margin-bottom: 3px" slot="title">{{ item.title }}</div>
  18. <a-avatar class="card-avatar" slot="avatar" :src="item.avatar" size="large"/>
  19. <div class="meta-content" slot="description">{{ item.content }}</div>
  20. </a-card-meta>
  21. <template class="ant-card-actions" slot="actions">
  22. <a>操作一</a>
  23. <a>操作二</a>
  24. </template>
  25. </a-card>
  26. </template>
  27. </a-list-item>
  28. </a-list>
  29. </div>
  30. </template>
  31. <script>
  32. const dataSource = []
  33. for (let i = 0; i < 12; i++) {
  34. dataSource.push({
  35. title: 'Alipay',
  36. avatar: 'https://gw.alipayobjects.com/zos/rmsportal/WdGqmHpayyMjiEhcKoVE.png',
  37. content: '在中台产品的研发过程中,会出现不同的设计规范和实现方式,但其中往往存在很多类似的页面和组件,这些类似的组件会被抽离成一套标准规范。'
  38. })
  39. }
  40. export default {
  41. name: "CardList",
  42. data () {
  43. return {
  44. description: '段落示意:蚂蚁金服务设计平台 ant.design,用最小的工作量,无缝接入蚂蚁金服生态, 提供跨越设计与开发的体验解决方案。',
  45. linkList: [
  46. { icon: 'rocket', href: '#', title: '快速开始' },
  47. { icon: 'info-circle-o', href: '#', title: '产品简介' },
  48. { icon: 'file-text', href: '#', title: '产品文档' }
  49. ],
  50. extraImage: 'https://gw.alipayobjects.com/zos/rmsportal/RzwpdLnhmvDJToTdfDPe.png',
  51. dataSource
  52. }
  53. }
  54. }
  55. </script>
  56. <style lang="less" scoped>
  57. .card-avatar {
  58. width: 48px;
  59. height: 48px;
  60. border-radius: 48px;
  61. }
  62. .ant-card-actions {
  63. background: #f7f9fa;
  64. li {
  65. float: left;
  66. text-align: center;
  67. margin: 12px 0;
  68. color: rgba(0, 0, 0, 0.45);
  69. width: 50%;
  70. &:not(:last-child) {
  71. border-right: 1px solid #e8e8e8;
  72. }
  73. a {
  74. color: rgba(0, 0, 0, .45);
  75. line-height: 22px;
  76. display: inline-block;
  77. width: 100%;
  78. &:hover {
  79. color: #1890ff;
  80. }
  81. }
  82. }
  83. }
  84. .new-btn {
  85. background-color: #fff;
  86. border-radius: 2px;
  87. width: 100%;
  88. height: 186px;
  89. }
  90. .meta-content {
  91. position: relative;
  92. overflow: hidden;
  93. text-overflow: ellipsis;
  94. display: -webkit-box;
  95. height: 64px;
  96. -webkit-line-clamp: 3;
  97. -webkit-box-orient: vertical;
  98. }
  99. </style>