sagalbot / vue-sortable

A lightweight directive for reorderable drag-and-drop lists using RubaXa/Sortable
http://sagalbot.github.io/vue-sortable/
MIT License
722 stars 104 forks source link

Error when trying to initialize the directive #37

Open ventralnet opened 4 years ago

ventralnet commented 4 years ago

'Error in directive sortable bind hook: Sortable is not a constructor'

I assume the Sortable dependency did some breaking changes

foxbunny commented 4 years ago

Yup, appears Sortable dep now exports an object with the Sortable ctor as a member.

shortcodes commented 4 years ago

@foxbunny And what that means? And how to make it work?

foxbunny commented 4 years ago

@shortcodes I think it should be:

var Sortable = typeof require === 'function'
      ? require('sortablejs').Sortable // <-- this here
      : window.Sortable