1.1.2-alpha.4 • Published 5 years ago

drag-tree v1.1.2-alpha.4

Weekly downloads
2
License
GPL-3.0
Repository
github
Last release
5 years ago

draggable-tree

draggable tree for vue inspired by Ant Design Vue and Element

use

npm install drag-tree

API

Attributes

参数说明类型默认值
list(v-model)展示数据array-
props配置选项,具体看下表object-
render-content树节点的内容区的渲染 FunctionFunction({node}-
default-expand-all默认是否展开所有节点booleantrue
allow-drop拖拽时判定目标节点能否被放置。type 参数有三种情况:'top'、'mid' 和 'bottom',分别表示放置在目标节点前、插入至目标节点和放置在目标节点后Function(dragNode:{node,parent}, dragOverNode:{node,parent}, type)-
rowKey每条数据的主键String
selected-key当前选中的节点 keyString
expanded-keys当前展开的节点 keyString

Props

参数说明类型默认值
title指定节点标签为节点对象的某个属性值stringtitle
children指定子树为节点对象的某个属性值stringchildren

Events

事件名称说明回调参数
select节点被点击时的回调被点击的节点的数据
drop拖拽成功完成时触发的事件Function({dragNode,dragParentNode},{dropNode,dropParentNode},type)(同 allow-drop 的 type)
expand节点展开时触发的事件Function(expandedKeys,{expanded:Boolean, node:OriginNode, e:DomEvent}})

Scoped Slot

name说明
renderContent自定义树节点的内容,参数为 { node,parentNode }

TODO

  • slot,slot-scope
  • css style
  • add props for title,children
  • add props allow-drop
  • support clone from outside
  • global toggle expandAll
1.1.2-alpha.4

5 years ago

1.1.2-alpha.3

5 years ago

1.1.2-alpha.2

5 years ago

1.1.2-alpha.1

5 years ago

1.1.2-alpha.0

5 years ago

1.1.1

5 years ago

1.1.0

5 years ago

1.0.11

5 years ago

1.0.10

5 years ago

1.0.9

5 years ago

1.0.8

5 years ago

1.0.7

5 years ago

1.0.6

5 years ago

1.0.5

5 years ago

1.0.4

5 years ago

1.0.3

5 years ago

1.0.2

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago