Skip to content
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

Use element with attributes #316

Closed
cawa-93 opened this issue Dec 27, 2017 · 4 comments
Closed

Use element with attributes #316

cawa-93 opened this issue Dec 27, 2017 · 4 comments
Assignees

Comments

@cawa-93
Copy link

cawa-93 commented Dec 27, 2017

I want to recreate the following structure:

<v-layout row wrap>
  <v-flex> ... </v-flex>
  <v-flex> ... </v-flex>
  <v-flex> ... </v-flex>
</v-layout>

I use your library like this:

<draggable element="v-layout" v-model="pages">
  <v-flex v-for=" ... "> ... </v-flex>
</draggable>

As a result, I get almost the markup that I need, but the root element v-layout does not have the necessary attributes row and wrap. Is there a way to convey them?

@David-Desmaisons
Copy link
Member

Question: which is the UI framework that you are using?

Currently it is not possible to pass props from draggabe element to underlying created component.
That said I understand the value of such a feature. I will study if this possible.

@cawa-93
Copy link
Author

cawa-93 commented Dec 27, 2017

@David-Desmaisons
Copy link
Member

David-Desmaisons commented Dec 30, 2017

Corrected in version v.2.16.0.
See working example:
https://github.com/SortableJS/Vue.Draggable/blob/master/examples/Component2.html

@Steam1996
Copy link

Steam1996 commented Dec 23, 2018

Is this enhancement completed? I also try to do the same thing with vuetify, but I get 3 errors
Failed to mount component: template or render function not defined.. Error in mounted hook: "Sortable: el must be HTMLElement, and not [object Comment]". Sortable: 'el' must be HTMLElement, and not [object Comment].


<v-layout class="mt-5" row>
  <draggable element="v-layout" row wrap v-model="$props.tasks" :options="{chosenClass: 'chosen-img'}">
    <v-flex md4 class="mx-5" v-for="(a, i) in $props.tasks" :key="i">
      <img class="draggable-img" :src="a.img" alt="img" />
    </v-flex>
    </VueDraggable>
</v-layout>


Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants