vue js 定位到頁面指定位置


 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是否為空的情況


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM