修改最大宽度和高度的处理逻辑

v1.2.0
于肖磊 2025-02-27 11:52:40 +08:00
parent 326820cc51
commit 3b85dc9949
1 changed files with 2 additions and 2 deletions

View File

@ -201,8 +201,8 @@ watch(() => props.customList, async (val) => {
if (typeof max_size === 'number' && max_size >= 0) {
const scaledMaxSize = max_size * props.scale;
const autoStyle = 'auto;';
const maxSizeStyle = ` max-${type}: ${scaledMaxSize}px;`;
const whiteSpaceStyle = type === 'width' ? ' white-space:nowrap;' : '';
const maxSizeStyle = scaledMaxSize > 0 ? ` max-${type}: ${scaledMaxSize}px;` : '';
const whiteSpaceStyle = type === 'width' && scaledMaxSize <= 0 ? ' white-space:nowrap;' : '';
return `${ autoStyle }${ maxSizeStyle }${ whiteSpaceStyle }`;
} else {
return 'auto;';