element ui 下拉樹組件el-tree半選節點和選中節點的提交與回顯


 

HTML:

<el-tree :data="treedata" :default-expand-all="isExpandAll" :indent="50" :check-strictly="false" show-checkbox  node-key="id" :key="Math.random()" ref="tree" highlight-current :props="defaultProps">
</el-tree>

提交:

console.log("保存樹權限數組:","  勾選項的數組  ",this.$refs.tree.getCheckedKeys(),' 帶半勾選項的數組 ',this.$refs.tree.getHalfCheckedNodes().concat(this.$refs.tree.getCheckedNodes()))

回顯設置:

for(var i in this.treecheck){
     this.$refs.tree.setChecked(this.treecheck[i],true,false);//通過setChecked()方法回顯
}

  


免責聲明!

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



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