2

element的树型拖拽怎么关闭同级禁用的图标

 2 years ago
source link: https://www.oschina.net/question/5494038_2324356
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

element的树型拖拽怎么关闭同级禁用的图标

osc_58913667 发布于 昨天 17:35
up-4bb3bded85c6c19e8affe4c0f3f126e88be.jpg
HTML:
  < el-tree
           class = "menustree"
             :data = "menuList"
             node-key = "id"
             :filter-node-method = "filterNode"
             draggable = "true"
             ref = "tree"
             accordion
             icon-class = "none"
             :allow-drop = "allowDrag"  
             @node-drop = "nodedrop"
</ el-tree>
  allowDrag ( draggingNode ,  dropNode ,  type ) {
       debugger
       if  ( draggingNode . data . level  ===  dropNode . data . level ) {  
         //aboveId是父节点id
         if  ( draggingNode . parent . id  ===  dropNode . parent . id ) {
           return   type  ===  "prev"  ||  type  ===  "next" ; 
           //type === "prev" || type === "next";    
          console . log ( type );
      }  else  {
         // 不同级进行处理
         return   false ;
       console . log ( type );

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK