Is it possible to change a data property from a directive using single file components?
For instance, consider the following code...
export default {
name: 'app',
data: function() {
return {
is_loading: true
}
},
directives: {
do_something: {
bind: function(el, binding, vnode) {
// How can we alter the value of 'is_loading' property?
}
}
}
}
I initially attempted this.is_loading = false
, but unfortunately, this
turned out to be undefined
.