beforeConfirm () { this.detailInfos.userPointList.map((item, index) => { if (item.show && !item.rejectReason) { item.showRed = true this.$set(this.detailInfos.userPointList, index, item) } }) setTimeout(() => { document.getElementsByClassName('rejectReason')[0].scrollIntoView({ behavior: 'smooth', // 平滑过渡 block: 'start' // 上边框与视窗顶部平齐。默认值 }) }, 200) },
以上代码是做了一个,点击确认校验列表rejectreason是否为空的情况