基于iview的tree组件拓展了树节点拖拽功能,默认使用了远程加载 #1192
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
增加树节点拖拽组件源码至_c/tree-drag
增加相应demo和路由、i18n文字配置
组件目前开放了
1个参数
// 接收返回Promise的方法
getChild: {
type: Function,
default: null
}
2个事件
// 节点选择触发
// node 选择的树节点
on-select(node)
// 拖拽完成触发
// dragNode 拖拽的树节点
// dropNode 拖拽至目标的树节点
// position 拖拽到目标节点的位置('before' 'inner' 'after')
// event 拖拽结束事件本身
on-drag(dragNode, dropNode, position, event)
该组件个人维护地址: https://github.com/Flywor/iview-tree-drag
提供该功能加入参考
欢迎拍砖指导