For AI agents: the complete documentation index is available at https://docs.halo.run/llms.txt, the full documentation bundle is available at https://docs.halo.run/llms-full.txt, and this page is available as Markdown at https://docs.halo.run/developer-guide/plugin/api-reference/ui/components/v-permission.md.

v-permission

HasPermission 组件相同,此指令也是用于根据权限控制元素的显示与隐藏。

使用方式

<script lang="ts" setup>
import { VButton } from "@halo-dev/components";
</script>

<template>
  <VButton type="danger" v-permission="['system:posts:manage']">删除</VButton>
</template>