vue2js - how to propagate selected index with chosen select value in a direcitve
问题 Please look at the code below. The first select box is created with chosen js. When changed it should propagate its changed value to the model to which its bound ( cityid ). The second normal select box is working fine and its value is propagated. Vue.directive('chosen', { bind: function (el, binding, vnode, oldVnode) { Vue.nextTick(function() { $(el).chosen({ width:'100%' }).change(function(){ alert($(el).val()); vnode.context.$emit('input', $(el).val()); }); }); }, update: function(el,