简体   繁体   中英

Is it possible to use a quasar component with vue draggable?

I've been trying to get this done for awhile, but can't seem to get it to work. I'm using the Quasar CLI, and it'd be appreciated if someone could show me an example of how to do this.

<draggable v-model="myList" draggable=".item" tag="q-virtual-scroll">
</draggable>

I've tried using a quasar component by passing in the component in the tag prop, but that doesn't seem to be working. So any advice would be appreciated.

I tried an example from website and it works.

I am using :list="list" , but v-model="list" is just another way to declare data. So both work.

       <draggable
          :list="list"
          :disabled="!enabled"
          class="list-group"
          ghost-class="ghost"
          @start="dragging = true"
          @end="dragging = false"
        >
          <div
            class="list-group-item"
            v-for="element in list"
            :key="element.name"
          >
            {{ element.name }}
          </div>
        </draggable>

Draggable is declared like this:

import draggable from 'vuedraggable'

I think you should give entire code, it would help.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM