/vue-ac

Vue Access Control plugin

Primary LanguageJavaScriptGNU General Public License v3.0GPL-3.0

vue-ac

Vue Access Control Plugin

install

import Vue from 'vue'
import VueAc from 'vue-ac'
import router from './router'
Vue.use(VueAc, {
  router,
  roles: ['user']
})

Useage

element

<div v-ac="['admin']"></div>

router

router.addRoutes([
  {
    path: '/path',
    name: 'name',
    component: Component,
    meta: {
      ac: ['admin'],
      fail: '/401'
    }
  }
])