index.vue 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. <template>
  2. <div class="divider">
  3. <div class="title">
  4. <div class="left">
  5. <div class="ele-bg-primary box"></div>
  6. <slot name="title"
  7. ><span :style="{ 'font-size': size }">{{ title }}</span></slot
  8. >
  9. </div>
  10. <div class="right">
  11. <slot />
  12. </div>
  13. </div>
  14. <div class="ele-bg-primary" style="width: 100%; height: 2px"></div>
  15. </div>
  16. </template>
  17. <script>
  18. export default {
  19. props: {
  20. title: {
  21. typeof: String,
  22. default: '信息'
  23. },
  24. size: {
  25. typeof: String,
  26. default: '20px'
  27. }
  28. }
  29. };
  30. </script>
  31. <style lang="scss" scoped>
  32. .divider {
  33. margin-bottom: 20px;
  34. .title {
  35. display: flex;
  36. align-items: flex-end;
  37. justify-content: space-between;
  38. margin-bottom: 10px;
  39. .left {
  40. display: flex;
  41. align-items: center;
  42. }
  43. .right {
  44. margin-right: 20px;
  45. }
  46. .box {
  47. width: 8px;
  48. height: 20px;
  49. margin-right: 10px;
  50. }
  51. span {
  52. font-size: 20px;
  53. }
  54. }
  55. }
  56. </style>