moduleLeft.vue 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  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: url('@/assets/images/vent/homeNew/Lefttop.png');
  27. }
  28. }
  29. .module-content {
  30. --image-model_original_title_bg: url('@/assets/images/vent/homeNew/Lefttop.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) 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_left_title_bg.png') no-repeat;
  51. // background-size: 100% 100%;
  52. // position: relative;
  53. // text-align: right;
  54. // padding: 4px 10% 0 0;
  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. // right: 0;
  63. // top: 0;
  64. // }
  65. // .close-btn {
  66. // transform: rotate(-90deg);
  67. // }
  68. .module-slot {
  69. height: calc(100% - 33px);
  70. width: calc(100% - 20px);
  71. backdrop-filter: blur(5px);
  72. // #182d47
  73. background-color: var(--vent-configurable-original-module-bg);
  74. margin-left: 10px;
  75. }
  76. // Transition动画相关
  77. .v-enter-active,
  78. .v-leave-active {
  79. transition: all 0.3s ease;
  80. }
  81. .v-enter-from,
  82. .v-leave-to {
  83. // opacity: 1;
  84. transform: translateX(-100%);
  85. // transform: scaleY(0);
  86. // transform-origin: center top;
  87. }
  88. </style>