zoukankan      html  css  js  c++  java
  • el-tree给已知的key值加disabled

     data(){

    return{

    treeBudgetSelect:[],

    budgetIds:[3,4]

    }

    }

    methods:{
    this.setDisabled(this.treeBudgetSelect, this.budgetIds)
    // 已经选择的不能编辑
        setDisabled(treeData, key) {
          key.forEach(k => {
            const loop = (data) => {
              for (const item of data) {
                if (item.treedataid === k) {
                  item.disabled = true
                  break
                }
                if (item.childList && item.childList.length) {
                  loop(item.childList)
                },
              }
            }
            loop(treeData)
          })
        },
    }
  • 相关阅读:
    CentOS 7 安装java 环境
    CentOS 7 替换网易yum 源
    九度:题目1553:时钟
    Maximum Subarray
    职场细节
    poj2524 Ubiquitous Religions
    九度 1526:朋友圈
    程序载入
    设备管理
    操作系统系列
  • 原文地址:https://www.cnblogs.com/hellofangfang/p/13748084.html
Copyright © 2011-2022 走看看