Vue.directive('customselect', {
params: ['selectedTask'],
bind: function () {
var that = this;
$(this.el)
.select2()
.on('change', function () {
that.set(this.value);
if (!this.name.match(/[a-z]/i)) {
console.log('selected-task->'+that.params.selectedTask); // selected-task->undefined
}
})
},
});
Is there a way to access the params.selectedTask
during the onchange
event? I attempted using this.params.selectedTask
, however it still returns undefined.