"use strict";(self["webpackChunkscui"]=self["webpackChunkscui"]||[]).push([[8083],{63472:function(e,t,a){a.r(t),a.d(t,{default:function(){return c}});var l=a(66252);const r=(0,l.Uk)("v-auth=\"'user.add'\""),n=(0,l.Uk)("v-auth=\"['user.no','user.add']\""),p=(0,l.Uk)("v-role=\"'admin'\""),u=(0,l.Uk)("v-role=\"['SA','admin']\""),i={style:{"margin-top":"15px"}},m={style:{"margin-top":"15px"}},d={style:{"margin-top":"15px"}},o=(0,l.Uk)("复制");function y(e,t,a,y,s,w){const v=(0,l.up)("el-button"),c=(0,l.up)("el-alert"),g=(0,l.up)("el-card"),h=(0,l.up)("el-tag"),f=(0,l.up)("el-input"),x=(0,l.up)("el-main"),_=(0,l.Q2)("auth"),W=(0,l.Q2)("role"),k=(0,l.Q2)("time"),U=(0,l.Q2)("copy");return(0,l.wg)(),(0,l.j4)(x,null,{default:(0,l.w5)((()=>[(0,l.Wm)(g,{shadow:"never",header:"v-auth 高精度权限控制"},{default:(0,l.w5)((()=>[(0,l.wy)(((0,l.wg)(),(0,l.j4)(v,{type:"primary"},{default:(0,l.w5)((()=>[r])),_:1})),[[_,"user.add"]]),(0,l.wy)(((0,l.wg)(),(0,l.j4)(v,{type:"primary"},{default:(0,l.w5)((()=>[n])),_:1})),[[_,["user.no","user.add"]]]),(0,l.Wm)(c,{title:"v-auth指令 是$AUTH的语法糖, 原先需要使用v-if来判断是否有权限, 使用指令将减少代码冗余. 并且支持传入数组,有一项满足就判断有权限",style:{"margin-top":"20px"}})])),_:1}),(0,l.Wm)(g,{shadow:"never",header:"v-role 角色权限控制",style:{"margin-top":"15px"}},{default:(0,l.w5)((()=>[(0,l.wy)(((0,l.wg)(),(0,l.j4)(v,{type:"primary"},{default:(0,l.w5)((()=>[p])),_:1})),[[W,"admin"]]),(0,l.wy)(((0,l.wg)(),(0,l.j4)(v,{type:"primary"},{default:(0,l.w5)((()=>[u])),_:1})),[[W,["SA","admin"]]]),(0,l.Wm)(c,{title:"v-role指令 是$ROLE的语法糖, 原理是判断是否含有用户所在的角色别名",style:{"margin-top":"20px"}})])),_:1}),(0,l.Wm)(g,{shadow:"never",header:"v-time 时间转换",style:{"margin-top":"15px"}},{default:(0,l.w5)((()=>[(0,l._)("p",null,[(0,l.wy)((0,l.Wm)(h,{format:"yyyy-MM-dd hh:mm:ss"},null,512),[[k,1630117968295]])]),(0,l._)("p",i,[(0,l.wy)((0,l.Wm)(h,null,null,512),[[k,s.time1,void 0,{tip:!0}]])]),(0,l._)("p",m,[(0,l.wy)((0,l.Wm)(h,null,null,512),[[k,s.time2,void 0,{tip:!0}]])]),(0,l._)("p",d,[(0,l.wy)((0,l.Wm)(h,null,null,512),[[k,s.time3,void 0,{tip:!0}]])]),(0,l.Wm)(c,{title:"指令方式日期时间转换,如设置'tip'修饰符将会转换成相对时间,并且每60秒自动更新",style:{"margin-top":"20px"}})])),_:1}),(0,l.Wm)(g,{shadow:"never",header:"v-copy 一键复制",style:{"margin-top":"15px"}},{default:(0,l.w5)((()=>[(0,l.Wm)(f,{type:"textarea",rows:2,placeholder:"请输入内容",modelValue:s.copyText,"onUpdate:modelValue":t[0]||(t[0]=e=>s.copyText=e)},null,8,["modelValue"]),(0,l.wy)(((0,l.wg)(),(0,l.j4)(v,{type:"primary",style:{"margin-top":"15px"}},{default:(0,l.w5)((()=>[o])),_:1})),[[U,s.copyText]]),(0,l.Wm)(c,{title:"点击复制按钮会将文本框绑定的值复制到剪切板, 试着粘贴到其他地方看看效果",style:{"margin-top":"20px"}})])),_:1})])),_:1})}var s={name:"directive",data(){return{time1:new Date,time2:(new Date).setMinutes((new Date).getMinutes()-1),time3:(new Date).setMinutes((new Date).getMinutes()-120),copyText:"测试复制内容"}},created(){}},w=a(83744);const v=(0,w.Z)(s,[["render",y]]);var c=v}}]);