vue-sortable icon indicating copy to clipboard operation
vue-sortable copied to clipboard

Error when trying to initialize the directive

Open ventralnet opened this issue 5 years ago • 3 comments

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

I assume the Sortable dependency did some breaking changes

ventralnet avatar Dec 13 '19 18:12 ventralnet

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

foxbunny avatar Dec 24 '19 13:12 foxbunny

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

shortcodes avatar Jan 27 '20 12:01 shortcodes

@shortcodes I think it should be:

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

foxbunny avatar Jan 27 '20 12:01 foxbunny