moduleRight.vue 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  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" @click="handleClickDetail">详情</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. // 和 ./moduleLeft 一样,针对动画做了一些修改
  19. defineProps<{ title: string; visible: boolean; visibleDetail: boolean }>();
  20. const emit = defineEmits(['close', 'click', 'handleClickDetail']);
  21. function closeModel() {
  22. emit('close');
  23. }
  24. function clickHandler() {
  25. emit('click');
  26. }
  27. //详情点击
  28. function handleClickDetail() {
  29. emit('handleClickDetail');
  30. }
  31. </script>
  32. <style lang="less" scoped>
  33. @import '/@/design/theme.less';
  34. @{theme-deepblue} {
  35. .module-content {
  36. --image-model_original_title_bg: url('@/assets/images/themify/deepblue/home-container/configurable/gasInjection/2-1.png');
  37. --image-model_original_border_bg: url('@/assets/images/themify/deepblue/home-container/configurable/gasInjection/2-4.png');
  38. }
  39. }
  40. .module-content {
  41. --image-model_original_title_bg: url('@/assets/images/gasInjection/2-1.png');
  42. --image-model_original_border_bg: url('@/assets/images/gasInjection/2-4.png');
  43. --bg-height: 40px;
  44. color: #fff;
  45. box-sizing: border-box;
  46. position: absolute;
  47. width: 100%;
  48. height: 100%;
  49. }
  50. .module-content__title__expand {
  51. display: flex;
  52. justify-content: space-between;
  53. align-items: center;
  54. width: 100%;
  55. height: var(--bg-height);
  56. background: var(--image-model_original_title_bg) no-repeat;
  57. background-size: 100% 100%;
  58. position: relative;
  59. padding-left: 45px;
  60. // padding-top: 4px;
  61. margin-bottom: 5px;
  62. font-size: 18px;
  63. font-weight: 700;
  64. // font-family: 'douyuFont';
  65. line-height: var(--bg-height);
  66. }
  67. .module-slot {
  68. height: calc(100% - 33px);
  69. // width: calc(100% - 20px);
  70. width: 100%;
  71. // backdrop-filter: blur(5px);
  72. // #182d47
  73. background: var(--image-model_original_border_bg) no-repeat;
  74. background-size: 100% 100%;
  75. }
  76. .detail-text {
  77. color: #2cb6ff;
  78. cursor: pointer;
  79. font-family: 'douyuFont';
  80. font-size: 13px;
  81. }
  82. // Transition动画相关
  83. .v-enter-active,
  84. .v-leave-active {
  85. transition: all 0.3s ease;
  86. }
  87. .v-enter-from,
  88. .v-leave-to {
  89. // opacity: 1;
  90. transform: translateX(100%);
  91. // transform: scaleY(0);
  92. // transform-origin: center top;
  93. }
  94. </style>