moduleLeft-green.vue 2.4 KB

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