React's mouseEvent doesn't have offsetX/offsetY

前端 未结 2 2118
我在风中等你
我在风中等你 2021-02-06 21:10

I try get position of click relative to element, but event doesn\'t have offsetX.

onClick(e) {
  console.log(e.offsetX) // returns undefined
  console.log(e.targ         


        
2条回答
提交回复
热议问题