2024-06-30 15:03:37 +08:00
|
|
|
<!--
|
|
|
|
Access control component for fine-grained access control.
|
|
|
|
-->
|
|
|
|
<script lang="ts" setup>
|
|
|
|
interface Props {
|
|
|
|
/**
|
|
|
|
* Specified role is visible
|
|
|
|
* - When the permission mode is 'frontend', the value can be a role value.
|
|
|
|
* - When the permission mode is 'backend', the value can be a code permission value.
|
|
|
|
* @default ''
|
|
|
|
*/
|
2024-07-05 23:15:46 +08:00
|
|
|
roles?: string[];
|
2024-06-30 15:03:37 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
defineOptions({
|
2024-07-05 23:15:46 +08:00
|
|
|
name: 'FrontendAuthority',
|
2024-06-30 15:03:37 +08:00
|
|
|
});
|
|
|
|
|
|
|
|
withDefaults(defineProps<Props>(), {
|
2024-07-05 23:15:46 +08:00
|
|
|
roles: undefined,
|
2024-06-30 15:03:37 +08:00
|
|
|
});
|
|
|
|
</script>
|
|
|
|
|
|
|
|
<template>
|
|
|
|
<slot></slot>
|
|
|
|
</template>
|