moduleBottom.vue 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  1. <template>
  2. <Transition class="module-bottom">
  3. <!-- 正常展示模块时 -->
  4. <div v-if="visible" class="module-content">
  5. <div class="module-content__title__expand">
  6. <span class="action-btn close-btn" @click="closeModel"></span>
  7. {{ title }}
  8. </div>
  9. <div class="module-slot">
  10. <slot></slot>
  11. </div>
  12. </div>
  13. <!-- 隐藏模块时 -->
  14. <!-- <div v-else class="w-100%">
  15. <div class="module-content__title">
  16. <span class="action-btn show-btn" @click="showModel"></span>
  17. {{ title }}
  18. </div>
  19. </div> -->
  20. </Transition>
  21. </template>
  22. <script lang="ts" setup>
  23. defineProps<{ title: string; visible: boolean }>();
  24. const emit = defineEmits(['close']);
  25. function closeModel() {
  26. emit('close');
  27. }
  28. </script>
  29. <style lang="less" scoped>
  30. .module-bottom {
  31. --bg-height: 33px;
  32. color: #fff;
  33. box-sizing: border-box;
  34. position: absolute;
  35. .module-content {
  36. width: 100%;
  37. height: 100%;
  38. }
  39. .module-content__title__expand {
  40. width: 100%;
  41. height: var(--bg-height);
  42. background: url('@/assets/images/home-container/configurable/model_original_title_bg_expand.png') no-repeat;
  43. background-size: 100% 100%;
  44. position: relative;
  45. text-align: center;
  46. line-height: var(--bg-height);
  47. }
  48. // .module-content__title {
  49. // width: 50%;
  50. // height: var(--bg-height);
  51. // background: url('../../../../../assets/images/home-container/configurable/model_bottom_title_bg.png') no-repeat;
  52. // background-size: 100% 100%;
  53. // position: relative;
  54. // text-align: left;
  55. // padding-left: 5%;
  56. // }
  57. // 固定在父容器右上角的按钮图标
  58. // .action-btn {
  59. // width: 18px;
  60. // height: 18px;
  61. // background: url('../../../../../assets/images/home-container/configurable/expand.svg') no-repeat center;
  62. // position: absolute;
  63. // left: 0;
  64. // top: 0;
  65. // }
  66. // .show-btn {
  67. // transform: rotate(-90deg);
  68. // }
  69. .module-slot {
  70. height: calc(100% - 33px);
  71. width: calc(100% - 15px);
  72. backdrop-filter: blur(5px);
  73. background-color: #6ad6ff1c;
  74. margin-left: 5px;
  75. }
  76. }
  77. // Transition动画相关
  78. .v-enter-active,
  79. .v-leave-active {
  80. transition: all 0.3s ease;
  81. }
  82. .v-enter-from,
  83. .v-leave-to {
  84. opacity: 0;
  85. transform: translateY(-33px);
  86. }
  87. </style>