const valid = await ruleFormRef.value.validate().catch(() => {});
if (!valid) {
const isError = document.getElementsByClassName('is-error');
if (isError[0]) {
isError[0].scrollIntoView({
behavior: 'smooth',
block: 'center',
});
}
return;
}
const valid = await ruleFormRef.value.validate().catch(() => {});
if (!valid) {
const isError = document.getElementsByClassName('is-error');
if (isError[0]) {
isError[0].scrollIntoView({
behavior: 'smooth',
block: 'center',
});
}
return;
}
本文标题:vue中大表单提交时,滚动到报错位置
本文链接:https://www.haomeiwen.com/subject/fuozmjtx.html
网友评论