moduleLeft-warn.vue 2.1 KB

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