[Vuejs]-Vue js jquery switcher

0👍

Your directive is never actually updating because you’re not passing a value to v-checkbox. That shorthand you’re using is for when you just need the update method.

You might just want to do something like this in bind since the plugin appears to detect if the element is selected or not.

Vue.directive('checkbox', {
  bind: function () {
    $(this.el).switcher();
  }
});

This way it’ll just be applied once.

Leave a comment