Vue input data, after input, click to determine, if the user has not entered, high scroll to the place where there is no input, how to achieve

Vue enter the page. After the user has recorded all the data, click OK (upload the data to the server), and the front end determines whether there is a null value. If any data is not submitted, it is highly automatically scrolled to the place where there is no input (not realized), and the color is highlighted (color highlighting has been realized). How can it be achieved?

clipboard.png Click to confirm the backfill if a null value scrolls to the corresponding height

the structure of the data is

             let newList = [];
                        let aMap = {};
                         articleList.forEach(a => {
                          if (!(("" + a.deviceId) in aMap)){
                            aMap["" + a.deviceId] = newList.length
                            newList.push({
                              deviceId: a.deviceId,
                              deviceName:a.deviceName,
                              areaId:a.areaId,
                              xianshide:xianshide,
                              yanse:"red",
                              list: [{
                                  deviceId:a.deviceId,
                                  areaId:a.areaId,
                                  areaName:a.areaName,
                                  itemId:a.itemId,
                                  itemName:a.itemName,
                                  itemType:a.itemType,
                                  measureUnit:a.measureUnit,
                                  taskId:a.taskId,
                                  taskName:a.taskName,
                                  taskStatus:a.taskStatus,
                                  unitId:a.unitId,
                                  unitName:a.unitName,
                                  value:null,
                                  zheng:true,
                                  yichang:false,
                                  SeleteShow:false,//
                                  shifoyichang:"",//
                                  NotLost:false,//
                                  HieghtDom:document.documentElement.scrollTop || document.body.scrollTop,//dom
                              }]
                            })
                          } else {
                            newList[aMap["" + a.deviceId]].list.push({
                                yanse:"red",
                                 xianshide:xianshide,
                                deviceId:a.deviceId,
                                areaId:a.areaId,
                                  areaName:a.areaName,
                                  deviceName:a.deviceName,
                                  itemId:a.itemId,
                                  itemName:a.itemName,
                                  itemType:a.itemType,
                                  measureUnit:a.measureUnit,
                                  taskId:a.taskId,
                                  taskName:a.taskName,
                                  taskStatus:a.taskStatus,
                                  unitId:a.unitId,
                                  unitName:a.unitName,
                                  value:null,
                                  zheng:true,
                                  yichang:false,
                                  SeleteShow:false,//
                                  shifoyichang:"",//
                                  NotLost:false,//
                                  HieghtDom:document.documentElement.scrollTop || document.body.scrollTop,//dom
                            })
                          }
                        })    

I want to get the height of each dom and page through the HieghtDom attribute and scroll directly, but each is 0 and there is no height

when you click OK

      if(newList[i].list[j].value == null && shifoyichang == null){
                            newList[i].list[j].NotLost=true;
                        }

I changed the color of the box to a highlight, but what if I scroll to a height where there is no input value? Or is it realized by other methods?

Sep.10,2021

el.scrollIntoView (true) can be achieved by scrolling to the location of the specified element, or by using window.scrollTo (0, specify the scroll height).


agree with upstairs,
but scrollIntoView there are some compatibility issues
if you use scrollTo , you need to know where to scroll

.

you need to know the location of an element. You can get

through offestTop .
MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b3de9e-2c3db.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b3de9e-2c3db.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?