goview_vue/dist/static/js/index-b2b393ee.js
2023-06-06 13:24:29 +08:00

2 lines
1.2 KiB
JavaScript

import{d as b,a1 as c,bo as o,r as h,o as t,c as i,F as C,q as x,av as d,bp as z,b as B,w,D as q,E as I,h as R}from"./index-4ec2ce15.js";import{i as F}from"./icon-42fa39e7.js";const g={class:"go-apple-control-btn"},L=["onClick"],M=b({__name:"index",props:{mini:{request:!1,type:Boolean,default:!1},disabled:{request:!1,type:Boolean,default:!1},hidden:{request:!1,type:Array,default(){return[]}},narrow:{request:!1,type:Boolean,default:!1}},emits:["close","remove","resize","fullResize"],setup(s,{emit:u}){const a=s,{CloseIcon:f,RemoveIcon:_,ResizeIcon:m}=F.ionicons5,p=c(()=>y.filter(r=>a.hidden.findIndex(l=>r.key==l)===-1)),v=c(()=>a.narrow&&o(!0)),y=[{title:"关闭",key:"close",icon:f},{title:"缩小",key:"remove",icon:_},{title:v.value?"缩小":"放大",key:a.narrow?"fullResize":"resize",icon:m}],k=e=>{e==="fullResize"&&o(),e==="remove"&&o(!0)&&o(),u(e)};return(e,r)=>{const l=h("n-icon");return t(),i("div",g,[(t(!0),i(C,null,x(p.value,n=>(t(),i("div",{key:n.key,class:d(["btn",[n.key,s.disabled&&"disabled",s.mini&&"mini"]]),onClick:z(D=>k(n.key),["stop"])},[B(l,{size:"10",class:d(["icon-base",{hover:!s.disabled}])},{default:w(()=>[(t(),q(I(n.icon)))]),_:2},1032,["class"])],10,L))),128))])}}});const N=R(M,[["__scopeId","data-v-281e8a22"]]);export{N as M};