Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在尝试制作一个带有可拖动文本的 SVG 形状,尽管我让它可拖动,但文本仍然是与形状分开的实体。可以将文本和形状合二为一,以便我可以将它们拖到一起吗?
先感谢您。
SG
当然,将文本和形状都设为元素的子<g>元素并使其<g>可拖动。您可能希望在<g>pointer-events="none" 中创建文本和形状,以便所有鼠标事件都转到<g>.
<g>