this.$refs['form'].validate(valid => { if(valid){ // 验证通过 } else { // 验证失败 this.$nextTick(() => { let isError = document.getElementsByClassName('is-error') isError[0].scrollIntoView({ block: 'center', behavior: 'smooth' }) }) } })
标签:滚动,验证,elementui,表单,valid,isError From: https://www.cnblogs.com/Intellectualscholar/p/17662316.html