moduleRightBottom.vue 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  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" class="title">{{ 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/right3.png');
  27. }
  28. }
  29. .module-content {
  30. --image-model_original_title_bg: url('@/assets/images/vent/homeNew/right3.png');
  31. --bg-height: 40px;
  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. .title {
  48. font-size: 14px;
  49. font-weight: 500;
  50. color: #fff;
  51. float: left;
  52. padding-left: 23px; font-family: 'douyuFont';
  53. line-height: 30px;
  54. }
  55. // .module-content__title {
  56. // width: 50%;
  57. // height: var(--bg-height);
  58. // background: url('@/assets/images/home-container/configurable/model_left_title_bg.png') no-repeat;
  59. // background-size: 100% 100%;
  60. // position: relative;
  61. // text-align: right;
  62. // padding: 4px 10% 0 0;
  63. // }
  64. // 固定在父容器右上角的按钮图标
  65. // .action-btn {
  66. // width: 18px;
  67. // height: 18px;
  68. // background: url('@/assets/images/home-container/configurable/expand.svg') no-repeat center;
  69. // position: absolute;
  70. // right: 0;
  71. // top: 0;
  72. // }
  73. // .close-btn {
  74. // transform: rotate(-90deg);
  75. // }
  76. .module-slot {
  77. height: calc(100% - 33px);
  78. width: calc(100% - 20px);
  79. backdrop-filter: blur(5px);
  80. margin-left: 10px;
  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>