chiCard.vue 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  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. .title-left {
  57. display: flex;
  58. i {
  59. align-self: center;
  60. font-size: 24px;
  61. }
  62. div {
  63. align-self: center;
  64. font-size: 16px;
  65. }
  66. }
  67. .more{
  68. color: #409eff;
  69. align-self: flex-end;
  70. font-size: 12px;
  71. }
  72. }
  73. .content {
  74. min-height: 50px;
  75. }
  76. }
  77. </style>