【问题标题】:how can i connect the blocks without a button , but a spot on the box where we can drag the arrow from one box to other我怎样才能在没有按钮的情况下连接块,但是在盒子上的一个点上,我们可以将箭头从一个盒子拖到另一个盒子
【发布时间】:2019-09-25 07:53:16
【问题描述】:

我想手动连接 div,而不是使用按钮。当用户想要连接一条线时,他应该能够将箭头从一个框拖到另一个框

https://stackblitz.com/edit/angular-jsplumb?file=app%2Fapp.component.html

点击链接

我想在没有按钮的情况下手动连接 div

提前致谢

【问题讨论】:

  • 我知道你的问题有点老了,但我回答你的问题了吗?

标签: angular angular6 jsplumb


【解决方案1】:

您需要为元素设置端点,以便进行拖放连接器并告诉哪个端点是源,哪个是目标。所以,你需要这样使用addEndpoint函数:

this.jsPlumbInstance.addEndpoint("Source", {
  anchor: "Right",
  connector: ['Flowchart'],
  isSource: true
});
this.jsPlumbInstance.addEndpoint("Target1", {
  anchor: "Left",
  connector: ['Flowchart'],
  isTarget: true,
  endpoint: "Blank",
});

我更新了你的Stackblitz with my answer

更多信息在official documentation

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2020-10-19
    • 2019-06-30
    • 1970-01-01
    • 2016-04-12
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多