index-legacy.0e744c22.js 1.8 KB

12
  1. !function(){var t=document.createElement("style");t.innerHTML="._sticky_1yjvp_1{position:sticky;top:0;z-index:99}._white_1yjvp_6{background-color:#fff}._white_1yjvp_6>div{padding-top:.4rem;box-shadow:0 0 .26667rem rgba(216,216,216,.5)}._animationStyle_1yjvp_13{transition:all .2s}\n",document.head.appendChild(t),System.register(["./index-legacy.fba2875c.js","./index-legacy.33680739.js"],(function(t){"use strict";var e,i,o,n,s,a,c;return{setters:[function(t){e=t.d,i=t.Q,o=t.S,n=t.U,s=t.a2,a=t.j},function(t){c=t.d}],execute:function(){var f="_sticky_1yjvp_1",r="_animationStyle_1yjvp_13";t("T",e({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:function(t,e){var d=e.slots,y=e.emit,l=i({divStyle:{},heightV:0,sectionStyle:{width:"100%",height:"auto",left:"0"}}),u=o(),p=o();return n((function(){"top"===t.position?l.divStyle.top=t.offsetTop||"0px":l.divStyle.bottom=t.offsetBottom||"0px";try{c(p.value,(function(e){var i=e[0].contentRect.height;Math.abs(i-l.heightV)>1&&setTimeout((function(){!function(e){l.sectionStyle.height="".concat(e,"px"),l.heightV=e,document.documentElement.style.setProperty(t.varName,"".concat(e,"px")),y("barHeight",e)}(i)}),10)}))}catch(e){}})),s((function(){return t.offsetTop}),(function(){l.divStyle.top=t.offsetTop})),s((function(){return t.offsetBottom}),(function(){l.divStyle.bottom=t.offsetBottom})),function(){return a("div",{style:[l.sectionStyle],class:"sticky"===t.mode&&f},[a("div",{ref:u,class:["van-sticky","fixed"===t.mode?"van-sticky--fixed":"",r],style:[l.divStyle,l.sectionStyle]},[a("div",{ref:p,style:{position:"relative"}},[d.default&&d.default()])])])}}}))}}}))}();