refactor: 更多操作权限样式
This commit is contained in:
parent
77e37cc8fe
commit
4ebad9739d
|
@ -8,7 +8,7 @@
|
||||||
</el-button>
|
</el-button>
|
||||||
<el-dropdown-menu slot="dropdown">
|
<el-dropdown-menu slot="dropdown">
|
||||||
<el-dropdown-item v-for="(item, index) in commands" :key="index" @click.native.stop="click(item)"
|
<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">
|
<span class="tip-font" v-if="!item.children">
|
||||||
{{ item.label }}
|
{{ item.label }}
|
||||||
|
@ -37,6 +37,8 @@
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
import {hasPermissions} from "@/common/js/utils";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "MsSearchBar",
|
name: "MsSearchBar",
|
||||||
props: {
|
props: {
|
||||||
|
@ -64,6 +66,9 @@ export default {
|
||||||
if (item.callback) {
|
if (item.callback) {
|
||||||
item.callback();
|
item.callback();
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
disabled(permissions) {
|
||||||
|
return !hasPermissions(...permissions);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue