@wutubin/vue-directive
v1.0.0
Published
自定义vue指令
Downloads
1
Readme
vue-directive
安装
npm i @wtb/vue-directive
v-permission
许可指令。只有许可在授权内才渲染。
<div id="app">
<el-button v-permission:[auth]="['del']">无授权按钮,不显示</el-button>
<el-button v-permission:[auth]="['add']">add授权按钮,显示</el-button>
</div>
Vue.directive("permission", VueDirective.VPermission);
const app = new Vue({
data: {
auth: ["add", "edit"], // 权限
},
el: "#app",
});