[Enhancement] [tree] element-plus的tree拖拽不兼容触屏,我想添加touch事件,但在touchmove的事件中获取到的treeNode(目标位置)是被拖拽元素 #14790
qaq-qwq-qvq
started this conversation in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Feature type:
Other
Details
tree
Description
我直接在tree-node.vue的标签上添加了
在useDragNode.ts中的treeNodeDragStart、treeNodeDragOver、treeNodeDragEnd添加了一些非空判断
例如:
目前的效果就是在触摸状态下可以拖拽,但松手后被拖拽的部分会消失
我检查后发现应该是因为handleDragOver事件中获取到的目标位置参数props.node是被拖拽的元素,所以修改位置时会没有目标位置导致的消失
想问一下touchmove的事件中应该怎么获取目标位置,或者遇到的类似的情况是怎么解决的?
--------------------------------------------------------------------------English
I added it directly to the label of tree node. vue
Added some non null judgments to treeNodeDragStart, treeNodeDragOver, and treeNodeDragEnd in useDragNode.ts
For example:
The current effect is that it can be dragged in touch mode, but the dragged part will disappear after releasing the hand
After checking, I found that it should be because the target position parameter props.node obtained from the handleDragOver event is a dragged element, so when modifying the position, there will be no target position causing it to disappear
I would like to ask how to obtain the target location in the touchmove event, or how to solve similar situations encountered?
Beta Was this translation helpful? Give feedback.
All reactions