历史数据兼容

v1.2.0
于肖磊 2025-02-26 14:45:34 +08:00
parent f156491ae2
commit 51fde32ec4
1 changed files with 2 additions and 2 deletions

View File

@ -104,7 +104,7 @@ const updateLocation = (targetItem: HTMLElement, data_follow: { spacing: number
const locationValue = parseFloat(locationValueStr);
if (isNaN(locationValue) || scale <= 0 || (isX ? targetItem.clientWidth < 0 : targetItem.clientHeight < 0)) return 0;
return ((locationValue + data_follow.spacing) * scale) + (isX ? targetItem.clientWidth : targetItem.clientHeight);
return ((locationValue + (data_follow?.spacing || 0)) * scale) + (isX ? targetItem.clientWidth : targetItem.clientHeight);
} catch (error) {
return 0;
}
@ -187,7 +187,7 @@ watch(() => props.customList, async (val) => {
const percentage_count = (val: number, data_follow: { id: string, type: string }, type: string, is_auto?: string, max_size?: number) => {
// 'left''top'
if (['left', 'top'].includes(type)) {
const { id = '', type: follow_type = 'left' } = data_follow;
const { id = '', type: follow_type = 'left' } = data_follow || { id: '', type: 'left' };
// idfollow_typetype
if (id !== '' && follow_type === type) {
return `${val}px`;