chiCard.vue 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  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" @click="seeMore">查看更多></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. seeMore() {
  37. this.$emit("seeMore");
  38. },
  39. },
  40. };
  41. </script>
  42. <style scoped lang="scss">
  43. .card {
  44. border-radius: 4px;
  45. border: 1px solid #e6ebf5;
  46. background-color: #ffffff;
  47. overflow: hidden;
  48. color: #303133;
  49. -webkit-transition: 0.3s;
  50. transition: 0.3s;
  51. box-shadow: 0 2px 12px 0 #ddd8d8;
  52. margin-bottom: 10px;
  53. .title {
  54. color: #000;
  55. display: flex;
  56. border-bottom: 1px solid #e6ebf5;
  57. padding: 14px 15px 7px 10px;
  58. min-height: 40px;
  59. justify-content: space-between;
  60. margin: 0;
  61. .title-left {
  62. display: flex;
  63. i {
  64. align-self: center;
  65. font-size: 20px;
  66. }
  67. div {
  68. align-self: center;
  69. font-size: 16px;
  70. }
  71. }
  72. .more{
  73. color: #409eff;
  74. align-self: flex-end;
  75. font-size: 12px;
  76. cursor: pointer;
  77. }
  78. }
  79. .content {
  80. min-height: 50px;
  81. }
  82. }
  83. </style>