moduleBottom-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. }
  27. }
  28. .module-content {
  29. --image-model_original_title_bg_expand: url('@/assets/images/home-green/green-title-bg.png');
  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-2.png') no-repeat;
  38. background-size: 100% 100%;
  39. padding: 13px 15px 0px 15px;
  40. }
  41. .module-content__title__expand {
  42. width: 100%;
  43. height: var(--bg-height);
  44. position: relative;
  45. text-align: center;
  46. line-height: 0px;
  47. font-weight: bold;
  48. font-size: 16px;
  49. }
  50. // .module-content__title {
  51. // width: 50%;
  52. // height: var(--bg-height);
  53. // background: url('../../../../../assets/images/home-container/configurable/model_bottom_title_bg.png') no-repeat;
  54. // background-size: 100% 100%;
  55. // position: relative;
  56. // text-align: left;
  57. // padding-left: 5%;
  58. // }
  59. // 固定在父容器右上角的按钮图标
  60. // .action-btn {
  61. // width: 18px;
  62. // height: 18px;
  63. // background: url('../../../../../assets/images/home-container/configurable/expand.svg') no-repeat center;
  64. // position: absolute;
  65. // left: 0;
  66. // top: 0;
  67. // }
  68. // .show-btn {
  69. // transform: rotate(-90deg);
  70. // }
  71. .module-slot {
  72. height: calc(100% - 33px);
  73. width: calc(100% - 15px);
  74. -webkit-backdrop-filter: blur(5px);
  75. backdrop-filter: blur(5px);
  76. }
  77. // Transition动画相关
  78. .v-enter-active,
  79. .v-leave-active {
  80. transition: all 0.3s ease;
  81. }
  82. .v-enter-from,
  83. .v-leave-to {
  84. opacity: 0;
  85. transform: translateY(-33px);
  86. }
  87. </style>