vue-drag-resize
vue-drag-resize copied to clipboard
vue3 drag-handle _uid 的问题
设置了 drag-handle 后,控制台报 this._uid is undefined 错误。
定位到源代码是:
if (this.dragHandle && target.getAttribute('data-drag-handle') !== this._uid.toString()) { return; }
can't access _uid in vue3
I have this warning when enable drag handle [Vue warn]: Unhandled error during execution of native event handler at <VueDragResize dragHandle=".drag" key=0 w=140 ... > Please help. Thanks in advance
怎么解决呢?
怎么解决呢?
我把代码拉下来,自己做了一点点小修改,然后重新build。

感谢回复。 我干脆直接自己写了一个拖动。 这个组件在vue2很好用。
the problem is this._uid is undefined in Vue 3 unlike in Vue 2 which works perfectly.
so when using the dragHandle prop this line is causing the issue dragHandle.setAttribute('data-drag-handle', this._uid);
the only solution is to modify the this.uid by your own ID generator function or a utility that does this and rebuild as you did.
unfortunately, the library is not well maintained at this point so there are some Vue 3 issues. 😞
I hope @kirillmurashov gets back or at least opens up the door for other maintainers.