vue-element-admin 按鈕級別的權限判斷
https://panjiachen.github.io/vue-element-admin-site/zh/guide/essentials/permission.html#%E6%8C%87%E4%BB%A4%E6%9D%83%E9%99%90
選用第一種
js 代碼:https://github.com/PanJiaChen/vue-element-admin/tree/master/src/directive/permission
注冊全局,在main中進行注冊
// 權限框架注冊全局 import permission from '@/directive/permission/index.js' // 權限判斷指令 Vue.use(permission)
在需要的按鈕上 加上 權限
v-permission="['admin']"
實例
<el-button v-permission="['admin']">添加</el-button >
