Vue.draggable: MultiDrag: wrong order

Created on 10 Apr 2020  路  1Comment  路  Source: SortableJS/Vue.Draggable

I use MultiDrag.

After dropped, the order of items is wrong.

How can I fix this?

Jsfiddle link

https://jsfiddle.net/tokuiti/vL8d906b/14/

Step by step scenario

create nuxt app

$ yarn create nuxt-app app

add vuedraggable

$ yarn add vuedraggable

20200410T111832 b

modify pages/index.vue

<template lang="html">
  <div class="container">
    <div class="row">

      <div class="col-6">
        <draggable tag="ul" v-model="bs" multi-drag="true">
          <li v-for="b in bs" :key="b">
            {{ b }}
          </li>
        </draggable>
      </div>

      <div class="col-6">
        <pre>{{ bs }}</pre>
      </div>

    </div>
  </div>
</template>

<script>
  import draggable from 'vuedraggable'
  import { Sortable, MultiDrag } from 'sortablejs'

  Sortable.mount(new MultiDrag());

  export default {
    components: {
      draggable
    },
    data: () => ({
      bs: [...new Array(10)].map((b,i) => `b${i}`)
    })
  }
</script>

<style lang="css" scoped>
  .sortable-chosen,
  .sortable-selected {
    background-color: orange;
  }
</style>

20200410T111557 a

run

select items

20200410T115711

drag items

20200410T115745

drop items

20200410T115800 a

I expected following result.

20200410T120028 a

What is wrong with my codes?

>All comments

Multi drag is not supported by vue.draggable at this moment. It will be incorporated later.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ghost picture ghost  路  3Comments

Kuohao-wu picture Kuohao-wu  路  3Comments

Sualty picture Sualty  路  3Comments

Kgwkgwkgw picture Kgwkgwkgw  路  3Comments

Nrqz picture Nrqz  路  3Comments