We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
拖动元素进入放置目标(无嵌套)时, isOver会进行true -> false -> true的变化
const [dropCollect, drop] = useDrop({ accept: ['BOX'], collect: monitor => ({ isOver: monitor.isOver({ shallow: true }) }) }) const { isOver } = toRefs(dropCollect) watch(isOver, val => { console.log('val') }) // true // false // true
拖动进入时, 会打印true -> false -> true 请教是什么原因呢
The text was updated successfully, but these errors were encountered:
其实需求是没有成功放置的回调 放置成功后的逻辑在useDrop中drop回调内, 如果是没有成功放置(拖到到其他非目标区域松开鼠标)有办法执行回调么
Sorry, something went wrong.
可以使用useDrag的end事件,通过monitor.didDrop()来判断拖拽是否被处理
useDrag
end
monitor.didDrop()
查了一下, isOver的问题react-dnd也存在, 而且暂时还没有修复 react-dnd/react-dnd#3489
其实需求是没有成功放置的回调 放置成功后的逻辑在useDrop中drop回调内, 如果是没有成功放置(拖到到其他非目标区域松开鼠标)有办法执行回调么 可以使用useDrag的end事件,通过monitor.didDrop()来判断拖拽是否被处理
我试试, 蟹蟹大佬回复
No branches or pull requests
拖动元素进入放置目标(无嵌套)时, isOver会进行true -> false -> true的变化
拖动进入时, 会打印true -> false -> true
请教是什么原因呢
The text was updated successfully, but these errors were encountered: