下面是我的拖动源规范的 canDrag 方法:
const itemDragSource = {
canDrag(props, monitor) {
if(props.canDrag && !props.canDrag(props.itemData)) {
if(props.dragUndraggable){
debugger;
props.dragUndraggable(props.itemData, monitor.getInitialClientOffset());
}
return false;
}
return true;
}
}
问题是monitor.getInitialClientOffset返回null,那么getInitialSourceClientOffset和getClientOffset呢?关于此时如何获得鼠标位置的任何想法?