card.vue 766 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. <template>
  2. <view class="card-view">
  3. <view class="title">
  4. <slot name='title'>{{title}}</slot>
  5. <slot name='right'></slot>
  6. </view>
  7. <view class="content">
  8. <slot/>
  9. </view>
  10. </view>
  11. </template>
  12. <script>
  13. export default {
  14. props:{
  15. title:String
  16. }
  17. }
  18. </script>
  19. <style lang="scss" scoped>
  20. .card-view{
  21. background: #fff;
  22. border: 1rpx solid #ccc;
  23. border-radius: 12rpx;
  24. .title{
  25. display: flex;
  26. justify-content: space-between;
  27. align-items: center;
  28. font-size: $uni-font-size-base;
  29. font-weight: bold;
  30. padding: 10rpx;
  31. border-bottom: 1rpx solid #ccc;
  32. }
  33. .content{
  34. font-size: $uni-font-size-sm;
  35. }
  36. }
  37. </style>