// page bind ref
<el-form-item ref="name" label=" prop "> <el-input V-model =" dataform. name" placeholder=" placeholder "/> </el-form-item>Copy the code
/ / js processing
this.$refs['dataForm'].validate((valid,object) => { if (! This. ScrollView (object) return false} else {//Copy the code
// Scroll to fixed place
ScrollView (object) {for (const I in object) {let dom = this. If values for the array (Object. The prototype. ToString. Call (dom)! == '[object object]') {dom = dom[0]} dom.$el.scrollinToView ({// Scroll to the specified node // values start,center,end, Nearest, currently displayed in the middle of view area Block: 'center', // values include auto, instant,smooth, slow animation (currently slow) 'smooth'}) break // Because we only need to check one term, so we can break out of the loop}}Copy the code