diff --git a/CHANGELOG.md b/CHANGELOG.md index 58b1a828522192522664125bd47a0e13cb289e3e..b24b7f0b230277bbe070bceb57b7b3d12314858c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,10 @@ ## [Unreleased] +### Change + +- 模态弹框适配百分比显示及适配模态自定义参数配置 + ### Fixed - 修复悬浮工具栏分组项显示控制异常 diff --git a/src/util/app-modal/app-modal-component.tsx b/src/util/app-modal/app-modal-component.tsx index 4f36892b9421f84361d2fa1fda8f379311e7c0a3..b833002476ae7adb276f72d3d50d922a0549b625 100644 --- a/src/util/app-modal/app-modal-component.tsx +++ b/src/util/app-modal/app-modal-component.tsx @@ -12,6 +12,7 @@ import { Modal, ViewMode, } from '@ibiz-template/runtime'; +import { calcOpenModeStyle } from '@ibiz-template/core'; import './app-modal-component.scss'; export const AppModalComponent = defineComponent({ @@ -35,13 +36,17 @@ export const AppModalComponent = defineComponent({ }); const { width, height } = props.opts; if (width) { - customStyle.width = isNumber(width) ? `${width}px` : width; + customStyle.width = isNumber(width) + ? calcOpenModeStyle(width, 'modal') + : width; } else { // 默认全屏 customStyle.width = '100vw'; } if (height) { - customStyle.height = isNumber(height) ? `${height}px` : height; + customStyle.height = isNumber(height) + ? calcOpenModeStyle(height, 'modal') + : height; } else { // 默认全屏 customStyle.height = '100vh'; @@ -131,6 +136,7 @@ export const AppModalComponent = defineComponent({ style={this.customStyle} overlay={this.options.overlay} before-close={this.onBeforeClose} + {...this.options} > {slots}