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