refactor: 更多操作权限样式
This commit is contained in:
parent
77e37cc8fe
commit
4ebad9739d
|
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue