<img alt="" src={Url} onMouseDown={handleMouseDown} onMouseMove={handleMouseMove} onMouseUp={handleMouseUp}/>事件 let flag = false const handleMouseDown = () => { flag = true console.log('down') } const handleMouseMove = () => { if (flag) { console.log('move') } } const handleMouseUp = () => { console.log('up') flag = false }想要实现从图片中选取一个区域,当按下鼠标时可以监听到,按着移动和松开都监听不到。在原地按下松开可以监听到。请大家帮忙看看
添加回答
举报
0/150
提交
取消