moduleLeft.vue 2.5 KB

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