Plugin to access Neutronium root ViewModel from any components.
Installed by default by vue-cli-plugin-neutronium
$ npm install neutronium-vue-root-vm-access
In install.js
file add:
import VmAccess from "neutronium-vue-root-vm-access";
function vueInstanceOption(vm, Vue) {
Vue.use(VmAccess, vm);
///
}
Then to access root ViewModel in a component use this.$rootVm
:
methods:{
changeLanguage(value) {
this.$rootVm.Language = value;
}
}