2 lines
1.7 KiB
JavaScript
2 lines
1.7 KiB
JavaScript
import{d as S,Z as w,a0 as V,bj as M,L as W,p as $,r as C,a as D,ao as N,n as B,o as i,c as u,w as d,f as E,bk as L,bl as h,g as U,t as z,h as T,b as j,ai as q,bm as A,bn as F,bo as I,bp as Z,l as G}from"./index-D11HRvLC.js";const H=S({name:"DetailDrawer",__name:"detail-drawer",props:w({title:{},width:{}},{modelValue:{type:Boolean,default:!1},modelModifiers:{}}),emits:w(["update:modelValue"],["update:modelValue"]),setup(c,{emit:f}){const e=c,v=f,m=V(c,"modelValue"),b=M(),p=W(),a=$({width:0}),n=C(!1),x=D(()=>{if(e.width)return n.value?e.width[1]:e.width[0];const t=360,o=600;if(p.isMobile)return a.width*.9>=t?`${t}px`:"90%";let s=a.width*.3>=t?`${t}px`:"30%";s=a.width<=420?"90%":s;let l=a.width*.5>=o?`${o}px`:"50%";return l=a.width<=420?"90%":l,n.value?l:s}),r=()=>{a.width=document.documentElement.clientWidth};N(()=>{r(),window.addEventListener("resize",r)}),B(()=>{window.removeEventListener("resize",r)});const k=t=>{v("update:modelValue",t)};return(t,o)=>{const s=A,l=F,y=I,g=Z;return i(),u(g,{show:m.value,"onUpdate:show":[o[1]||(o[1]=_=>m.value=_),k],"display-directive":"if",width:x.value},{default:d(()=>[E(y,{title:e.title,"native-scrollbar":!1,closable:"","header-class":"operate-dawer-header"},L({header:d(()=>[U(z(e.title)+" ",1),!T(p).isMobile&&(!e.width||e.width&&e.width[0]!==e.width[1])?(i(),j("div",{key:0,quaternary:"",class:"fullscreen text-18px color-#6a6a6a",onClick:o[0]||(o[0]=_=>n.value=!n.value)},[n.value?(i(),u(s,{key:0})):(i(),u(l,{key:1}))])):q("",!0)]),default:d(()=>[h(t.$slots,"default",{},void 0,!0)]),_:2},[b.footer?{name:"footer",fn:d(()=>[h(t.$slots,"footer",{},void 0,!0)]),key:"0"}:void 0]),1032,["title"])]),_:3},8,["show","width"])}}}),K=G(H,[["__scopeId","data-v-c74d83e9"]]);export{K as _};
|