vue-draggable-nested-tree
vue-draggable-nested-tree copied to clipboard
限制拖放层级时placeholder未正确删除
onDragEnd(node, nodeVm, store, event, draggable_helper_option, draggable_helper_store) {
var from = node.level
var toLevel = store._data.dplh.level
var toParent = store._data.dplh.parent
var drop = true
// 第一层只能拖放到第一层
if ((from === 1 && toLevel !== 1) || (toLevel === 1 && from !== 1)) {
drop = false
}
// 只有第一层和分组层可以放入
if (typeof(toParent.type) !== 'undefined' && toParent.type !== 'Group') {
drop = false
}
return drop
}
我想要的限制是: 1/ 第一层元素只能在第一层元素间拖放 2/ 其他元素只能放入第一层下面或者类型为“Group"的节点下面(第一层类型未定义)
在使用中有时功能是正常的,有时在不能拖放的时候,placeholder未正确删除,导致树上有空白出现
@iLoveBug 最新版本有个限制层级的例子 https://github.com/phphe/vue-draggable-nested-tree/blob/master/src/examples/MaxLevel.vue
@iLoveBug 您好 onDragEnd(node, nodeVm, store, event, draggable_helper_option, draggable_helper_store) 这段代码是重写了愿方法吗?
你好,我已经换了另外一个框架解决了我的问题,谢谢!
在 2018年9月14日,上午9:12,mokansa [email protected] 写道:
@iLoveBug https://github.com/iLoveBug 您好 onDragEnd(node, nodeVm, store, event, draggable_helper_option, draggable_helper_store) 这段代码是重写了愿方法吗?
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/phphe/vue-draggable-nested-tree/issues/12#issuecomment-421199377, or mute the thread https://github.com/notifications/unsubscribe-auth/AnFC_4blkeSkbgdmixYIhUKFB5jPyVq0ks5uawJkgaJpZM4VXaSN.