欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

el-tree樹狀控件如何定位到選中的節(jié)點的位置

 更新時間:2024年08月15日 10:02:38   作者:言666  
這篇文章主要介紹了el-tree樹狀控件如何定位到選中的節(jié)點的位置,本文通過示例代碼給大家介紹的非常詳細,感興趣的朋友跟隨小編一起看看吧

效果圖

在el-tree 控件加 :render-content="renderContent"

在掉接口的方法中

實際有用的是setTimeout 方法和this.$refs.xxxxxx.setCheckedKeys([industrycodeList])

if(res.data.swindustrylist.length>0){
              res.data.swindustrylist.forEach(item => {
                industrycodeList.push(item.industrycode) 
                setTimeout(() => { 
                  const currentDom = document.querySelector('#A' + item.industrycode)
                  console.log('industrycodeList',industrycodeList)
                  console.log('item.industrycode',item.industrycode)
                  if (currentDom) {
                      currentDom.scrollIntoView()
                  } 
                }, 1000)
              }) 
              this.$refs.mappTree.setCheckedKeys([industrycodeList])
            } 

到此這篇關于el-tree樹狀控件定位到選中的節(jié)點的位置的文章就介紹到這了,更多相關el-tree定位到選中的節(jié)點的位置內(nèi)容請搜索腳本之家以前的文章或繼續(xù)瀏覽下面的相關文章希望大家以后多多支持腳本之家!

相關文章

最新評論