How do you access the Vue instance from a directive?
I have this HTML
<div id='vueApp' v-init='my initial data from server-side'>
and this script
var app = new Vue({
el: '#vueApp',
data: {
myData: null
}
});
Vue.directive('init', function(el, binding) {
app.myData = binding.value;
});
It throws this error:
Failed to resolve directive: init