1 |
- !function(){var t=document.createElement("style");t.innerHTML="._sticky_1s8d5_1{position:sticky;top:0;z-index:99}._white_1s8d5_6{background-color:#fff}._white_1s8d5_6>div{padding-top:.4rem;box-shadow:0 0 .26667rem rgba(216,216,216,.5)}._white-only_1s8d5_13{background-color:#fff}\n",document.head.appendChild(t),System.register(["./ResizeObserver.es-legacy.42c87f31.js","./index-legacy.dd465861.js"],(function(t){"use strict";var e,i,o,s;return{setters:[function(t){e=t.d,i=t.a0,o=t.c},function(t){s=t.u}],execute:function(){var n={sticky:"_sticky_1s8d5_1",white:"_white_1s8d5_6","white-only":"_white-only_1s8d5_13"};t("O",e({emits:["getHeight"],name:"o-sticky",props:{position:{type:String,default:"top"},background:{type:String,default:""},mode:{type:String,default:"fixed"},offsetTop:{type:String,default:"0px"},offsetBottom:{default:"0px"},varName:{type:String,default:"--header-height"}},data:function(){return{divStyle:{},heightV:0,sectionStyle:{width:"100%",height:"auto",left:"0"}}},mounted:function(){var t=this;"top"===this.position?this.divStyle.top=this.offsetTop||"0px":this.divStyle.bottom=this.offsetBottom||"0px";try{s(this.$refs.div2,(function(e){var i=e[0].contentRect.height;Math.abs(i-t.heightV)>1&&setTimeout((function(){t.__initHeight(i)}),10)}))}catch(e){console.log(e,"error useResizeObserver")}i((function(){}))},methods:{__initHeight:function(t){this.sectionStyle.height="".concat(t,"px"),this.heightV=t,document.documentElement.style.setProperty(this.varName,"".concat(t,"px")),this.$emit("getHeight",t)}},watch:{offsetTop:function(){this.divStyle.top=this.offsetTop},offsetBottom:function(){this.divStyle.bottom=this.offsetBottom}},render:function(){return o("div",{style:[this.sectionStyle],class:"sticky"===this.mode&&n.sticky},[o("div",{ref:"div",class:["van-sticky","fixed"===this.mode?"van-sticky--fixed":"",n[this.background]],style:[this.divStyle,this.sectionStyle]},[o("div",{ref:"div2"},[this.$slots.default&&this.$slots.default()])])])}}))}}}))}();
|