这是我的端点定义代码:
let addEndpoints = function(toId, sourceAnchors, targetAnchors) {
console.log(toId, sourceAnchors, targetAnchors);
for (var i = 0; i < sourceAnchors.length; i++) {
var sourceUUID = toId + sourceAnchors[i];
instance.addEndpoint(toId, sourceEndpoint, {
anchor: sourceAnchors[i],
uuid: sourceUUID
});
}
for (var j = 0; j < targetAnchors.length; j++) {
var targetUUID = toId + targetAnchors[j];
instance.addEndpoint(toId, targetEndpoint, {
anchor: targetAnchors[j],
// anchor: 'Continuous',
uuid: targetUUID
});
}
};
有人可以帮忙吗?
尝试为此使用beforeDrop
拦截器:
https://docs.jsplumbtoolkit.com/community/current/articles/events-community.html#evt-beforedrop
您可以在这里看到它的使用情况(不完全是您想要的使用方式,它会在此演示中弹出一个确认):
https://jsplumbtoolkit.com/community/demonstration/draggableConnectors
尝试将一个蓝色端点拖动到另一个蓝色端点之一。