haixuxu / vue-gscope

replace vuex with a tiny store

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

vue-scope

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>

About

replace vuex with a tiny store

License:MIT License


Languages

Language:JavaScript 100.0%