0๐
โ
I tried to call my example plugin, and it works, but property this.$a
was hidden.
But if you want to correctly registration: in some module, i found this registration, and it works!
Vue.use({
install(Vue, options = {}) {
Object.defineProperty(Vue.prototype, '$a', {
get() {
return (...data) => console.log(...data);
}
});
}
});
0๐
You need the add โ.jsโ to your reference in the plugins key.
plugins: [ '~/plugins/myplugin.js ' ],
Source:stackexchange.com