chiCard.vue 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. <template>
  2. <div class="card">
  3. <div class="title">
  4. <div class="title-left">
  5. <i :class="iconName"></i>
  6. <div style="margin-left: 5px">{{ title }}</div>
  7. </div>
  8. <div v-if="More" class="more">查看更多></div>
  9. </div>
  10. <div class="content">
  11. <slot name="content"></slot>
  12. </div>
  13. </div>
  14. </template>
  15. <script>
  16. export default {
  17. name: "chiCard",
  18. props: {
  19. title: {
  20. type: String,
  21. required: "",
  22. },
  23. iconName: {
  24. type: String,
  25. required: "",
  26. },
  27. More: {
  28. type: Boolean,
  29. default: false,
  30. },
  31. },
  32. data() {
  33. return {};
  34. },
  35. methods: {},
  36. };
  37. </script>
  38. <style scoped lang="scss">
  39. .card {
  40. border-radius: 4px;
  41. border: 1px solid #e6ebf5;
  42. background-color: #ffffff;
  43. overflow: hidden;
  44. color: #303133;
  45. -webkit-transition: 0.3s;
  46. transition: 0.3s;
  47. box-shadow: 0 2px 12px 0 #ddd8d8;
  48. margin-bottom: 10px;
  49. .title {
  50. color: #000;
  51. display: flex;
  52. border-bottom: 1px solid #e6ebf5;
  53. padding: 14px 15px 7px 10px;
  54. min-height: 40px;
  55. justify-content: space-between;
  56. margin: 0;
  57. .title-left {
  58. display: flex;
  59. i {
  60. align-self: center;
  61. font-size: 20px;
  62. }
  63. div {
  64. align-self: center;
  65. font-size: 16px;
  66. }
  67. }
  68. .more{
  69. color: #409eff;
  70. align-self: flex-end;
  71. font-size: 12px;
  72. }
  73. }
  74. .content {
  75. min-height: 50px;
  76. }
  77. }
  78. </style>