-
Notifications
You must be signed in to change notification settings - Fork 69
New issue
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
Cannot reorder within the same bag in Vue 2.0 #24
Comments
Alright so this is happening because of Vue 2.0. This is not a bug, but expected behavior. The key is with the comment here: Basically in order to get vue-dragula to work in Vue 2.0, you need to make sure that you pass to Here is an example of what I needed to do to get it to work in my project: amcsi/skill-builder@a221dd6 Tagging @deiucanta because you are the one that brought this issue to our attention. |
I need to re-open this, because it appears that I'm wrong. Unfortunately doing the separation between prop and local changes aren't enough, because although it will work for dragging around, if anything else is changed in the parent, then all the moving around stuff will be overridden If you look here vuejs/vue#2873 you'll find:
So unfortunately there is no way to have changes go upwards without using events or having something passed down that can be used. So this issue is going to need to stay until further notice, and until then this plugin is unfortunately not usable in Vue 2.0 |
I don't know how I missed this one... so it's not compatible with 2.0 yet? :( |
@vitobotta I made it compatible with Vue 2 now dev (still a WIP) and demo I still can't quite grasp the concept of bags however. I wish @amcsi or someone else "in the know" could explain the relationships between the VM model, containers, bags service etc. What are the constraints. When must things be called and configured in the Vue/component life cycle for Vue2? |
Unfortunately I don't quite know. It is like a group where items within a bag can only be moved to places where there's a bag with the same value. Kind of like a radio input's name attribute connects radio elements together. |
A solution for vue2 DOM order, we must provide a
|
@Astray-git as far as I know, |
How would you handle data mutation with vuex? By manually hooking into the |
Any news on this issue? I was just trying vue-dragula for the first time in a small vue 2.2.4 project, but can't manage to get re-ordering items in a list working. I added |
You can try using vue2-dragula which has a fully customizable data model and supports a single bag model. |
Ahhh, thanks Kristian! |
@josdejong Great to hear! You are very welcome to add your use case as an example in the new Wiki docs I've just added: Usage-examples |
I'm sorry I'm lacking time to work out an example for the examples section. I use dragula just to do reordering of rows in a table, it's a simple use case. |
Based on #19 (comment), indeed you cannot seem to reorder properly within the same bag.
I'm not yet sure if this is a Vue 2.0 issue or a vue-dragula issue. I'm trying to investigate, but I'm not that familiar with either projects.
I'm also having trouble creating a small example, so please help me out @Astray-git if you can
The text was updated successfully, but these errors were encountered: