moduleBottom.vue 2.1 KB

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