只是尝试打字it(),自动建议是isTag
我试过添加一个 jsconfig.json
{
"compilerOptions": {
"target": "es6"
},
"exclude": [
"node_modules",
"assets"
]
}
Run Code Online (Sandbox Code Playgroud)
感谢任何对此有建议的人!!
所以我有一个带有rect覆盖层的 d3 图表,用于mouseover保存事件上的十字准线元素。在覆盖层下,我有其他显示数据的矩形,这些数据mouseover也具有事件处理程序,但是覆盖层正在阻止mouseover下面的子矩形上的触发器事件。
let chartWindow = svg
.append("g");
/* this holds axis groups, and cadlestick group*/
let candleStickWindow = chartWindow.append("g")
//this event never fires
.on('mousemove', ()=>console.log('mouse move'));
let candlesCrosshairWindow = chartWindow
.append("rect")
.attr("class", "overlay")
.attr("height", innerHeight)
.attr("width", innerWidth)
.on("mouseover", function() {
crosshair.style("display", null);
})
.on("mouseout", function() {
crosshair.style("display", "none");
removeAllAxisAnnotations();
})
.on("mousemove", mousemove);
Run Code Online (Sandbox Code Playgroud)
具有CrosshairWindowCSS 属性pointer-events: all。如果我删除它,我的事件会在 上触发,candleStickWindow但不会在CrosshairWindow. 如何将鼠标事件获取到这两个元素上?
谢谢你的帮助!
更新 我将十字线矩形元素更改为位于底部,它有点起作用,烛台鼠标悬停事件起作用,但它阻止了十字线工作。