mauricius / vue-draggable-resizable

Vue3 Component for draggable and resizable elements.
https://mauricius.github.io/vue-draggable-resizable/
MIT License
3.28k stars 555 forks source link

when I add a 'draggable item' to the draggable list; The new item couldn't drag; #122

Closed tingshuai closed 5 years ago

tingshuai commented 5 years ago

as title; chinese:( 当我增加一个可拖拽项目,视图更新后新增加的项目不能拖拽 )

tingshuai commented 5 years ago

ezgif-5-8ea070db8aca

gorkys commented 5 years ago

这个应该是你使用时代码问题。只提供动图不提供代码是不友好的。

mauricius commented 5 years ago

That is probably a problem on your end. The fact that you're using drag&drop to add components may suggest that click events are hijacked, but I should definitely look at the code to understand what's wrong.

tingshuai commented 5 years ago

thank's all of your attention. that's the url of this product.----https://github.com/tingshuai/BusinessCenter the qf's branch I also think it's caused by drag and drop event. But I really don't know how it works and how to solve it.

mauricius commented 5 years ago

You are injecting the coordinates in each VDR instance using this code

:x="Number(item.style.left)" :y="Number(item.style.top)"

but casting something like 100px to a Number results in NaN. Use explicit numbers for that purpose.