PixelAI-admin/src/components/auth/authAll.vue

30 lines
637 B
Vue
Raw Normal View History

<template>
<div v-if="getUserAuthBtnList">
<slot />
</div>
</template>
<script lang="ts">
import { computed } from "vue";
import { useStore } from "/@/store/index.ts";
import { judementSameArr } from "/@/utils/arrayOperation.ts";
export default {
nane: "authAll",
props: {
value: {
type: Array,
default: () => [],
},
},
setup(props) {
const store = useStore();
// 获取 vuex 中的用户权限
const getUserAuthBtnList = computed(() => {
return judementSameArr(props.value, store.state.userInfos.authBtnList);
});
return {
getUserAuthBtnList,
};
},
};
</script>