1.0.0 • Published 5 years ago

neutronium-vue-root-vm-access v1.0.0

Weekly downloads
2
License
MIT
Repository
github
Last release
5 years ago

MIT License

Description

Plugin to access Neutronium root ViewModel from any components.

Installed by default by vue-cli-plugin-neutronium

Install

$ npm install neutronium-vue-root-vm-access

Usage

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;
    }
}
1.0.0

5 years ago