moduleLeftCenter.vue 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  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/left2.png');
  27. }
  28. }
  29. .module-content {
  30. --image-model_original_title_bg: url('@/assets/images/vent/homeNew/left2.png');
  31. --bg-height: 40px;
  32. color: #fff;
  33. box-sizing: border-box;
  34. position: absolute;
  35. width: 100%;
  36. height: 100%;
  37. }
  38. .title {
  39. font-size: 14px;
  40. font-weight: 500;
  41. color: #fff;
  42. float: right;
  43. padding-right: 25px;
  44. line-height: 30px;
  45. font-family: 'douyuFont';
  46. }
  47. .module-content__title__expand {
  48. width: 100%;
  49. height: var(--bg-height);
  50. background: var(--image-model_original_title_bg) no-repeat;
  51. background-size: 100% 100%;
  52. position: relative;
  53. text-align: center;
  54. line-height: var(--bg-height);
  55. }
  56. // .module-content__title {
  57. // width: 50%;
  58. // height: var(--bg-height);
  59. // background: url('@/assets/images/home-container/configurable/model_left_title_bg.png') no-repeat;
  60. // background-size: 100% 100%;
  61. // position: relative;
  62. // text-align: right;
  63. // padding: 4px 10% 0 0;
  64. // }
  65. // 固定在父容器右上角的按钮图标
  66. // .action-btn {
  67. // width: 18px;
  68. // height: 18px;
  69. // background: url('@/assets/images/home-container/configurable/expand.svg') no-repeat center;
  70. // position: absolute;
  71. // right: 0;
  72. // top: 0;
  73. // }
  74. // .close-btn {
  75. // transform: rotate(-90deg);
  76. // }
  77. .module-slot {
  78. height: calc(100% - 33px);
  79. width: calc(100% - 20px);
  80. backdrop-filter: blur(5px);
  81. margin-left: 10px;
  82. }
  83. // Transition动画相关
  84. .v-enter-active,
  85. .v-leave-active {
  86. transition: all 0.3s ease;
  87. }
  88. .v-enter-from,
  89. .v-leave-to {
  90. // opacity: 1;
  91. transform: translateX(-100%);
  92. // transform: scaleY(0);
  93. // transform-origin: center top;
  94. }
  95. </style>