multiColorBackground.vue 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. <template>
  2. <div class="main-bg">
  3. <div v-if="showGoBack" class="icon go-back" @click="handleClick"><</div>
  4. <div class="bg-top" :style="{height:(topHeight||4)+'rem'}">
  5. </div>
  6. <div class="fixed multi-blue">
  7. <slot name="header"></slot>
  8. </div>
  9. <div class="content" :class="{'full-height':showGoBack}">
  10. <slot></slot>
  11. </div>
  12. </div>
  13. </template>
  14. <script>
  15. export default {
  16. name: "multiColorBackground",
  17. props:['topHeight','showGoBack'],
  18. methods:{
  19. handleClick(){
  20. this.$router.go(-1);
  21. }
  22. }
  23. }
  24. </script>
  25. <style scoped>
  26. .bg-top{
  27. width: 100%;
  28. height: 4rem;
  29. background-color: #60c0ff;
  30. }
  31. .main-bg{
  32. /*position: relative;*/
  33. height: 100%;
  34. background-color: #e8eff5;
  35. }
  36. .icon{
  37. position: absolute;
  38. display: inline-block;
  39. top:0.6rem;
  40. left: 0.5rem;
  41. font-size: 0.4rem;
  42. height: 0.4rem;
  43. width: 0.2rem;
  44. color: white;
  45. z-index: 6;
  46. }
  47. .content{
  48. position: absolute;
  49. width: 100%;
  50. /*left: 0.4rem;*/
  51. top:0;
  52. height: 100%;
  53. overflow-y: scroll;
  54. z-index: 4;
  55. }
  56. .content.full-height{
  57. height: 100%;
  58. }
  59. </style>