Advertisement
maxisoft

Untitled

Apr 23rd, 2019
114
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Vue.directive('select2', {
  2.     twoWay: true,
  3.     inserted: function (el) {
  4.         $(el).select2()
  5.             .on("select2:select", function(e) {
  6.                 alert($(el).val());
  7.                // this.set($(el).val());
  8.             }.bind(this));
  9.     },
  10.     update: function(nv, ov) {
  11.         $(this.el).trigger("change");
  12.     }
  13. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement