refactor: 更多操作权限样式

This commit is contained in:
chenjianxing 2021-07-12 17:48:40 +08:00 committed by jianxing
parent 77e37cc8fe
commit 4ebad9739d
1 changed files with 6 additions and 1 deletions

View File

@ -8,7 +8,7 @@
</el-button>
<el-dropdown-menu slot="dropdown">
<el-dropdown-item v-for="(item, index) in commands" :key="index" @click.native.stop="click(item)"
v-permission="item.permissions"
:disabled="disabled(item.permissions)"
>
<span class="tip-font" v-if="!item.children">
{{ item.label }}
@ -37,6 +37,8 @@
</template>
<script>
import {hasPermissions} from "@/common/js/utils";
export default {
name: "MsSearchBar",
props: {
@ -64,6 +66,9 @@ export default {
if (item.callback) {
item.callback();
}
},
disabled(permissions) {
return !hasPermissions(...permissions);
}
}
}