To start:
$ npm install
To build your plugin:
$ npm run build
usage
npm install vue-gscope --save-dev
import VueScope from "vue-gscope";
const states = {
app: {
activePanel: false
},
user: {
name: "xxx"
}
};
const scope = new VueScope.Scope(states);
Vue.use(VueScope, scope);
// usage in component
console.log(this.$scope.user);
<template>
<div class="userinfo">
{{$scope.user.name}}
</div>
</template>