fix(decorate): cap slider dialog preview height with viewport-based max-height

- Remove fixed inline preview height/background on image and video panels
- Apply max-height calc(72vh - 60px) to preview area and .hz-u-img (object-fit: cover)
- Improves layout on smaller viewports and tall images

Made-with: Cursor
This commit is contained in:
zhangjing1
2026-03-23 10:23:24 +08:00
parent 32bf2ae494
commit 2f20aeb5d1

View File

@@ -8,7 +8,6 @@
<div
class="wgts-slider-dialog-left"
v-if="sliderForm.media_type === 'img'"
:style="`height:${h}px;background:#f5f5f7`"
>
<SpImage
v-if="!sliderForm.imgUrl"
@@ -39,7 +38,7 @@
/>
</div>
<div class="wgts-slider-dialog-left" v-else :style="`height:${h}px;background:#f5f5f7`">
<div class="wgts-slider-dialog-left" v-else>
<SpImage v-if="!videoUrlStr" class="sp-image" fit="scale-down" />
<video-player
v-if="videoUrlStr"
@@ -470,6 +469,7 @@ export default {
display: flex;
align-items: center;
justify-content: center;
max-height: calc(72vh - 60px)!important;
.overlay {
position: absolute;
@@ -573,3 +573,11 @@ export default {
}
}
</style>
<style lang="scss">
.wgts-slider-dialog {
.hz-u-img {
object-fit: cover;
max-height: calc(72vh - 60px) !important;
}
}
</style>