vue-permission

1.0.12 • Public • Published

vue-permission

NPM version build status Test coverage David deps Known Vulnerabilities npm download

Install

$ npm i vue-permission --save

Usage

import VuePermission 'vue-permission';
 
Vue.use(VuePermission);
 
Vue.permission.authorize({'create': true, 'del': false});
 
Vue.permission.hasPermission('del'); // console.log(false);
 
Vue.permission.god = true; // all permissions return true
 
Vue.permission.reset(); // clear the permissions and god flag.
 
// if u don't has permission the button will not show. and style display none.
<button v-permission='create'></button>

Example

Questions & Suggestions

Please open an issue here.

License

MIT

Readme

Keywords

none

Package Sidebar

Install

npm i vue-permission

Weekly Downloads

1

Version

1.0.12

License

MIT

Unpacked Size

172 kB

Total Files

17

Last publish

Collaborators

  • alex-zhang