Vue2+ElementUi
this.$refs['transferForm'].validate((valid) => {
if (!valid) {
setTimeout(() => {
document.getElementsByClassName('is-error')[0].scrollIntoView({ behavior: 'smooth' })
}, 0)
}
})
Vue3+ElementPlus
scroll-to-error
:scroll-into-view-options="{behavior:'smooth'}"