| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101 |
- <template>
- <Transition class="module-bottom">
- <div v-if="visible" class="module-content">
- <div v-if="title" class="module-content__title__expand">
- <span class="action-btn close-btn" @click="closeModel"></span>
- <span @click="clickHandler">{{ title }}</span>
- </div>
- <div class="module-slot">
- <slot></slot>
- </div>
- </div>
- </Transition>
- </template>
- <script lang="ts" setup>
- defineProps<{ title: string; visible: boolean }>();
- const emit = defineEmits(['close', 'click']);
- function closeModel() {
- emit('close');
- }
- function clickHandler() {
- emit('click');
- }
- </script>
- <style lang="less" scoped>
- @import '/@/design/theme.less';
- @{theme-deepblue} {
- .module-bottom {
- --image-model_bottom_title_bg_expand: url('@/assets/images/themify/deepblue/configurable/model_bottom_title_bg_expand.png');
- --image-expand: url('@/assets/images/themify/deepblue/configurable/expand.svg');
- }
- }
- .module-bottom {
- --image-model_bottom_title_bg_expand: url('@/assets/images/home-container/configurable/model_bottom_title_bg_expand.png');
- --image-expand: url('@/assets/images/home-container/configurable/expand.svg');
- --bg-height: 33px;
- color: #fff;
- box-sizing: border-box;
- position: absolute;
- .module-content {
- width: 100%;
- height: 100%;
- }
- .module-content__title__expand {
- width: 100%;
- height: var(--bg-height);
- line-height: var(--bg-height);
- background: var(--image-model_bottom_title_bg_expand) no-repeat;
- background-size: 100% 100%;
- position: relative;
- text-align: left;
- padding: 0 0 0 5%;
- }
- // .module-content__title {
- // width: 50%;
- // height: var(--bg-height);
- // background: url('@/assets/images/home-container/configurable/model_bottom_title_bg.png') no-repeat;
- // background-size: 100% 100%;
- // position: relative;
- // text-align: left;
- // padding-left: 5%;
- // }
- // 固定在父容器右上角的按钮图标
- .action-btn {
- width: 18px;
- height: 18px;
- background: var(--image-expand) no-repeat center;
- position: absolute;
- left: 0;
- top: 0;
- cursor: pointer;
- }
- .show-btn {
- transform: rotate(-90deg);
- }
- .module-slot {
- height: calc(100% - 33px);
- width: 100%;
- background-color: var(--vent-configurable-module-bg);
- }
- }
- // Transition动画相关
- .v-enter-active,
- .v-leave-active {
- transition: all 0.3s ease;
- }
- .v-enter-from,
- .v-leave-to {
- opacity: 0;
- transform: translateY(-33px);
- }
- </style>
|