import{w as S,x as o}from"./index-CL6hUm94.js";import{S as g,ae as _,u as s,q as k,a2 as v,a5 as c,a3 as N,G as n,k as a,ad as I,aa as t,a9 as u,n as D}from"./vue-DApy1uhY.js";import{F as M,G as B,S as E}from"./antd-B7v2hwFR.js";const V={__name:"index",props:{access:{type:[String,Number,Array],required:!0}},setup(d){const{hasAccess:l}=S();return(p,x)=>s(l)(d.access)?g(p.$slots,"default",{key:0}):_("",!0)}},w={class:"flex flex-col gap-2"},R={class:"c-primary"},C={__name:"common",setup(d){const{hasAccess:l,roles:p}=S();return(x,e)=>{var y;const i=M,r=B,f=V,m=E,A=k("access");return c(),v("div",w,[N("div",null,[e[0]||(e[0]=n(" 当前用户拥有权限列表 ")),N("a",R,I((y=s(p))==null?void 0:y.join(",")),1)]),e[7]||(e[7]=n(" 所有用户均可查看 细粒度控制到按钮级别 ")),a(i,{message:"使用Access组件"}),a(m,null,{default:t(()=>[a(f,{access:[s(o).USER,s(o).ADMIN]},{default:t(()=>[a(r,null,{default:t(()=>e[1]||(e[1]=[n("普通用户")])),_:1})]),_:1},8,["access"]),a(f,{access:s(o).ADMIN},{default:t(()=>[a(r,{type:"primary"},{default:t(()=>e[2]||(e[2]=[n(" 管理员 ")])),_:1})]),_:1},8,["access"])]),_:1}),a(i,{message:"使用useAccess组合式Api"}),a(m,null,{default:t(()=>[s(l)([s(o).USER,s(o).ADMIN])?(c(),u(r,{key:0},{default:t(()=>e[3]||(e[3]=[n(" 普通用户 ")])),_:1})):_("",!0),s(l)(s(o).ADMIN)?(c(),u(r,{key:1,type:"primary"},{default:t(()=>e[4]||(e[4]=[n(" 管理员 ")])),_:1})):_("",!0)]),_:1}),a(i,{message:"使用v-access指令"}),a(m,null,{default:t(()=>[D((c(),u(r,null,{default:t(()=>e[5]||(e[5]=[n(" 普通用户 ")])),_:1})),[[A,[s(o).USER,s(o).ADMIN]]]),D((c(),u(r,{type:"primary"},{default:t(()=>e[6]||(e[6]=[n(" 管理员 ")])),_:1})),[[A,s(o).ADMIN]])]),_:1})])}}};export{C as default};
