index-legacy-dbd3b3db.js 1.5 KB

1
  1. System.register(["./index-legacy-734c3dbe.js","./index-legacy-67665670.js"],(function(t,e){"use strict";var o,i,s,d,n,a,f;return{setters:[t=>{o=t.a},t=>{i=t.d,s=t.r,d=t.H,n=t.o,a=t.j,f=t.a}],execute:function(){var e=document.createElement("style");e.textContent="._sticky_4d2w6_1{position:sticky;top:0;z-index:99}._white_4d2w6_6{background-color:#fff}._white_4d2w6_6>div{padding-top:.4rem;box-shadow:0 0 .26667rem rgba(216,216,216,.5)}\n",document.head.appendChild(e),t("O",i({name:"m-sticky",props:{position:{type:String,"default":"top"},mode:{type:String,"default":"fixed"},offsetTop:{type:String,"default":"0px"},offsetBottom:{"default":"0px"},varName:{type:String,"default":"--header-height"}},emits:["barHeight"],setup(t,{slots:e,emit:i}){const c=s({divStyle:{},heightV:0,sectionStyle:{width:"100%",height:"auto",left:"0"}}),l=d(),r=d();return n((()=>{"top"===t.position?c.divStyle.top=t.offsetTop||"0px":c.divStyle.bottom=t.offsetBottom||"0px";try{o(r.value,(e=>{const o=e[0],{height:s}=o.contentRect;Math.abs(s-c.heightV)>1&&setTimeout((()=>{(e=>{c.sectionStyle.height=`${e}px`,c.heightV=e,document.documentElement.style.setProperty(t.varName,`${e}px`),i("barHeight",e)})(s)}),10)}))}catch(e){}})),a((()=>t.offsetTop),(()=>{c.divStyle.top=t.offsetTop})),a((()=>t.offsetBottom),(()=>{c.divStyle.bottom=t.offsetBottom})),()=>f("div",{style:[c.sectionStyle],"class":"sticky"===t.mode&&"_sticky_4d2w6_1"},[f("div",{ref:l,"class":["van-sticky","fixed"===t.mode?"van-sticky--fixed":""],style:[c.divStyle,c.sectionStyle]},[f("div",{ref:r},[e["default"]&&e["default"]()])])])}}))}}}));