How to give JointJS elements a remove tool?

前端 未结 4 1713
爱一瞬间的悲伤
爱一瞬间的悲伤 2020-12-09 06:53

In JointJS, links come with a handy responsive tool for removing links (when you hover over the link, an \"x\" appears, and clicking it removes the link). Elements, on the

4条回答
  •  自闭症患者
    2020-12-09 07:48

    Have a look at the HTML example on the JointJS website.

    As you can see the elements have a close button there, so there's no need to complicate things by creating your own. Simply create a view for your element that contains the HTML code for the button, as well as the event handling. It's all in the source code of the example.

    Note that the example doesn't provide you the CSS file for the HTML elements, but you also need it: http://resources.jointjs.com/tutorials/joint/tutorials/css/html-elements.css

提交回复
热议问题