zoukankan      html  css  js  c++  java
  • el-tree知识积累

    <el-tree :data="treedatalist" 
    show-checkbox 
    default-expand-all 
    :check-strictly="true" 
    node-key="id" ref="tree" 
    :default-checked-keys="mycheckedkeys" 
    @check-change="handleCheckChange"        
    :render-content="renderContent">
    :props="defaultProps">
    </el-tree>
    
    method:{
     renderContent (h, { node, data, store }) {
     return (
     <span class="custom-tree-node">
     <span>{node.label}&nbsp;&nbsp;</span>
     <span>
     <el-button size="mini" type="text" icon="el-icon-delete" on-click={() => this.remove(node, data)}></el-button>
     <el-button size="mini" type="text" icon="el-icon-edit" on-click={() => this.edit(node, data)}></el-button>
     </span>
     </span>);
     },
    }

    :check-strictly="true" 选择父节点时子节点不会被一起选中

    :default-checked-keys="mycheckedkeys" 设置默认选中的节点

    this.$refs.tree.getCheckedKeys() 获取被选中节点的id

    :render-content="renderContent"> 渲染el-tree renderContent增加删除、编辑节点的按钮

  • 相关阅读:
    uniGUI之uniEdit(23)
    ​Shiro授权
    Shiro密码重试次数限制
    Ehcache基础入门
    Shiro简单加密服务
    Shiro身份验证
    第二章、Web中使用shiro(实现登陆)
    第一章、认识Shiro
    使用IntelliJ/Eclipse生成类图
    Jedis操作Redis实例
  • 原文地址:https://www.cnblogs.com/cekong/p/10984517.html
Copyright © 2011-2022 走看看