Vue.Draggable icon indicating copy to clipboard operation
Vue.Draggable copied to clipboard

Make Vue.Dragable.For compatible with vuejs 2.0

Open ninmesara opened this issue 10 years ago • 9 comments

I'm getting the following error: TypeError: dragableForDirective is undefined. The relevant line in the traceback seems to be this one:

  • buildVueDragFor/vueDragFor.install() build.js line 1340 > eval:53

This happens just after Vue.use(VueDragableFor). Is there any information you'd like me to add?

ninmesara avatar Sep 30 '16 00:09 ninmesara

I'm using vuejs 2.0. Is this the reason?

ninmesara avatar Sep 30 '16 00:09 ninmesara

Hello @ninmesara, you are correct Vue.Dragable.For is currently only working with Vue.js 1. As directives have changed a lot in Vue.js 2.0, Vue.Dragable.For needs an important re-write. I am waiting for Vue 2.0 to stabilize before starting with work. I will rename this issue as a lembrete to make Vue.Dragable.For Vue 2.0 compatible.

David-Desmaisons avatar Sep 30 '16 00:09 David-Desmaisons

Vue 2.0 is pretty close, I can't imagine what would change at this point that would cause issues with rewriting it now.

robmpreston avatar Sep 30 '16 16:09 robmpreston

from https://github.com/vuejs/vue/issues/2873:

Directive interface change

In general, in 2.0 directives have a greatly reduced scope of responsibility: they are now only used for applying low-level direct DOM manipulations. In most cases, you should prefer using Components as the main code-reuse abstraction.

Directives no longer have instances - this means there's no more this inside directive hooks and bind, update and unbind now receives everything as arguments.

Note the binding object is immutable, setting binding.value will have no effect, and properties added to it will not be persisted. You can persist directive state on el if you absolutely need to:

Directive have changed a lot indeed.

David-Desmaisons avatar Sep 30 '16 16:09 David-Desmaisons

Sorry, I'm not sure you understood my comment.

My point is Vue 2.0 is at a stable enough point that you can begin work on the next version of Vue.Dragable.For. I'm well aware of the directive changes :)

robmpreston avatar Sep 30 '16 17:09 robmpreston

I got you now! You are correct it seems to be a good time to begin to work on this migration.

David-Desmaisons avatar Sep 30 '16 17:09 David-Desmaisons

yes, vue 2.0 has been just officially released 4 days ago. :)

beeplin avatar Oct 04 '16 23:10 beeplin

@beeplin , true: I am already working on migration to 2.0, Next version will probably be a component as directive have drastically changed in Vue.js 2.0.

David-Desmaisons avatar Oct 05 '16 00:10 David-Desmaisons

Migration done: new component named draggable created

David-Desmaisons avatar Oct 13 '16 03:10 David-Desmaisons