思路:
//动态路由meta通过code字段区别是什么菜单权限(与后台统一)
export const asyncRouterMap = [
{
path: '/role',
component: Layout,
name: 'role',
meta: { title: '角色管理', code: 'admin' },
children: [
{
path: 'index',
name: 'role',
component: _import('role/index'),
meta: { title: '角色管理', code: 'admin' }
}
]
}
]
<!--通过getuserInfo接口获取用户信息,返回每个按钮的权限数组actions,页面判断是否显示此动作按钮-->
<el-button
v-show="actions.indexOf('/api/Employee/{id}-DELETE') !== -1"
v-if="scope.row.active" type="info" @click="deleteItem(scope.row.id)">
删除
</el-button>