fix(modal): fullscreen height calculation error #203

This commit is contained in:
vben 2021-01-19 22:40:43 +08:00
parent ca4f1a8faf
commit b45f8c5021

View File

@ -36,8 +36,8 @@
props: { props: {
loading: propTypes.bool, loading: propTypes.bool,
useWrapper: propTypes.bool.def(true), useWrapper: propTypes.bool.def(true),
modalHeaderHeight: propTypes.number.def(50), modalHeaderHeight: propTypes.number.def(57),
modalFooterHeight: propTypes.number.def(54), modalFooterHeight: propTypes.number.def(74),
minHeight: propTypes.number.def(200), minHeight: propTypes.number.def(200),
height: propTypes.number, height: propTypes.number,
footerOffset: propTypes.number.def(0), footerOffset: propTypes.number.def(0),
@ -137,7 +137,7 @@
if (props.fullScreen) { if (props.fullScreen) {
realHeightRef.value = realHeightRef.value =
window.innerHeight - props.modalFooterHeight - props.modalHeaderHeight; window.innerHeight - props.modalFooterHeight - props.modalHeaderHeight - 28;
} else { } else {
realHeightRef.value = props.height realHeightRef.value = props.height
? props.height ? props.height
@ -145,6 +145,9 @@
? maxHeight ? maxHeight
: realHeight; : realHeight;
} }
console.log('======================');
console.log(realHeightRef.value, props);
console.log('======================');
emit('height-change', unref(realHeightRef)); emit('height-change', unref(realHeightRef));
} catch (error) { } catch (error) {
console.log(error); console.log(error);