moduleBottom.vue 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  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. @import '/@/design/theme.less';
  24. @{theme-deepblue} {
  25. .module-content {
  26. --image-model_original_title_bg_expand: url('@/assets/images/themify/deepblue/home-container/configurable/model_original_title_bg_expand.png');
  27. }
  28. }
  29. .module-content {
  30. --image-model_original_title_bg_expand: url('@/assets/images/home-container/configurable/model_original_title_bg_expand.png');
  31. --bg-height: 33px;
  32. color: #fff;
  33. box-sizing: border-box;
  34. position: absolute;
  35. width: 100%;
  36. height: 100%;
  37. }
  38. .module-content__title__expand {
  39. width: 100%;
  40. height: var(--bg-height);
  41. background: var(--image-model_original_title_bg_expand) no-repeat;
  42. background-size: 100% 100%;
  43. position: relative;
  44. text-align: center;
  45. line-height: var(--bg-height);
  46. }
  47. // .module-content__title {
  48. // width: 50%;
  49. // height: var(--bg-height);
  50. // background: url('../../../../../assets/images/home-container/configurable/model_bottom_title_bg.png') no-repeat;
  51. // background-size: 100% 100%;
  52. // position: relative;
  53. // text-align: left;
  54. // padding-left: 5%;
  55. // }
  56. // 固定在父容器右上角的按钮图标
  57. // .action-btn {
  58. // width: 18px;
  59. // height: 18px;
  60. // background: url('../../../../../assets/images/home-container/configurable/expand.svg') no-repeat center;
  61. // position: absolute;
  62. // left: 0;
  63. // top: 0;
  64. // }
  65. // .show-btn {
  66. // transform: rotate(-90deg);
  67. // }
  68. .module-slot {
  69. height: calc(100% - 33px);
  70. width: calc(100% - 15px);
  71. backdrop-filter: blur(5px);
  72. background-color: var(--vent-configurable-original-module-bg);
  73. margin-left: 5px;
  74. }
  75. // Transition动画相关
  76. .v-enter-active,
  77. .v-leave-active {
  78. transition: all 0.3s ease;
  79. }
  80. .v-enter-from,
  81. .v-leave-to {
  82. opacity: 0;
  83. transform: translateY(-33px);
  84. }
  85. </style>