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

How to get the container when drag into another container? #8

Open
varHarrie opened this issue Aug 23, 2016 · 2 comments
Open

How to get the container when drag into another container? #8

varHarrie opened this issue Aug 23, 2016 · 2 comments

Comments

@varHarrie
Copy link

example:

<template>
  <div>
    <div v-for="c in categories">
      <p>{{c.name}}</p>
      <ul v-sortable="{group:'list',onEnd:onEnd}">
        <li v-for="item in c.list">{{item}}</li>
      </ul>
    </div>
  </div>
</template>

<script>
  export default {
    data () {
      return {
        categories: [{
          _id: '0000000001',
          name: 'in progress',
          list: ['111', '222']
        }, {
          _id: '0000000002',
          name: 'plan',
          list: ['333']
        }, {
          _id: '0000000003',
          name: 'completed',
          list: []
        }]
      }
    },
    methods: {
      onEnd (e) {
        console.log(e)
        console.log(e.from === e.to)    // why? Both of they refer to `from element`
      }
    }
  }
</script>

Or JS Bin

Why e.from will be equal to e.to?
And is there any way to get both element the item drag from and to, how to get the category too.

@robverhoef
Copy link

That would make sense.
But you can use the 'onAdd' event to achieve that.

@isaacqian
Copy link

That would make sense. But you can use the 'onAdd' event to achieve that.

good

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

No branches or pull requests

3 participants