@zeesuu/permission

1.0.5 • Public • Published

@zeesuu/permission

$ npm i @zeessu/permission -S

Usage

. Step 1

Import the directive

// main.js

import Permission from 'comp/Permission';
Vue.use(Permission);

. Step 2

// login.js

login().then((res) => {
  // customice set permission to store  => set store getters to  store.getters.$permission
  this.store.dispatch('setPermissionActionName', res.permission);
});
<!-- vue file -->

<template>
  <div>
    <!-- Set this buttons permission array-->
    <!-- the button will be show if store.getters.$permission has one or more permission in this directive params-->
    <button v-permission="["article:editor"]"></button>
  </div>
</template>

Readme

Keywords

Package Sidebar

Install

npm i @zeesuu/permission

Weekly Downloads

1

Version

1.0.5

License

MIT

Unpacked Size

3.19 kB

Total Files

5

Last publish

Collaborators

  • zeesuu