最佳答案
在 svg 上使用 pointer-events: none;
。它对我有用。
The element is never the target of mouse events; however, mouse events may target its descendant elements if those descendants have pointer-events set to some other value. In these circumstances, mouse events will trigger event listeners on this parent element as appropriate on their way to/from the descendant during the event capture/bubble phases.
https://developer.mozilla.org/en-US/docs/Web/CSS/pointer-events
关于jquery - 使用 <use> 元素时,SVG 单击事件不会触发/冒泡,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24078524/