fix:修改 backtopRef Error描述

This commit is contained in:
sight 2021-12-20 14:14:20 +08:00
parent 91ccfc58bb
commit f506ebcf30

View File

@ -98,7 +98,7 @@ const getScrollTarget = () => {
if (!targetElement.parentElement) throw new Error(`target parent element is not existed: ${props.target}`); if (!targetElement.parentElement) throw new Error(`target parent element is not existed: ${props.target}`);
targetElement.parentElement.style.position = 'relative'; targetElement.parentElement.style.position = 'relative';
console.log(backtopRef.value); console.log(backtopRef.value);
if (!backtopRef.value) throw new Error(`target ref is null: ${props.target}`); if (!backtopRef.value) throw new Error(`backtop component ref is null: ${props.target}`);
backtopRef.value.style.position = props.position; backtopRef.value.style.position = props.position;
} }
return targetElement; return targetElement;