layout.vue 884 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. <template>
  2. <div class="layout">
  3. <div class="layout-left">
  4. <slot name="left" />
  5. </div>
  6. <div class="layout-center">
  7. <slot name="center" />
  8. </div>
  9. <div class="layout-right">
  10. <slot name="right" />
  11. </div>
  12. <div class="layout-bg" />
  13. </div>
  14. </template>
  15. <style lang="scss" scoped>
  16. .layout {
  17. height: 100%;
  18. padding: 0 50px;
  19. display: flex;
  20. align-items: center;
  21. position: relative;
  22. &-right,
  23. &-left {
  24. width: 1370px;
  25. height: 100%;
  26. z-index: 1;
  27. }
  28. &-center {
  29. width: calc(100% - 1370px - 1370px);
  30. height: 100%;
  31. z-index: 1;
  32. }
  33. &-bg {
  34. position: absolute;
  35. z-index: 0;
  36. left: 50%;
  37. top: 50%;
  38. width: calc(100% - 1260px - 1260px);
  39. height: 100%;
  40. transform: translate(-50%, -50%);
  41. background: url(../assets/img/4.png) no-repeat top center;
  42. background-size: cover;
  43. }
  44. }
  45. </style>