moduleLeft.vue 2.3 KB

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