Vue Access Control Plugin
import Vue from 'vue'
import VueAc from 'vue-ac'
import router from './router'
Vue.use(VueAc, {
router,
roles: ['user']
})
<div v-ac="['admin']"></div>
router.addRoutes([
{
path: '/path',
name: 'name',
component: Component,
meta: {
ac: ['admin'],
fail: '/401'
}
}
])