1 |
- !function(){var t=document.createElement("style");t.innerHTML="._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(t),System.register(["./index-legacy.eb062188.js"],(function(t){"use strict";var i,e,s,o;return{setters:[function(t){i=t.d,e=t._,s=t.c,o=t.an}],execute:function(){var h={sticky:"_sticky_4d2w6_1",white:"_white_4d2w6_6"};t("O",i({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"}},data:()=>({divStyle:{},heightV:0,sectionStyle:{width:"100%",height:"auto",left:"0"}}),mounted(){"top"===this.position?this.divStyle.top=this.offsetTop||"0px":this.divStyle.bottom=this.offsetBottom||"0px",e((()=>{const{height:t}=o(this.$refs.div);this.__initHeight(t),setTimeout((()=>{const{height:t}=o(this.$refs.div);this.__initHeight(t)}),200),setTimeout((()=>{const{height:t}=o(this.$refs.div2);t!==this.heightV&&"top"===this.position&&this.__initHeight(t)}),1e3)}))},methods:{__initHeight(t){this.sectionStyle.height=`${t}px`,this.heightV=t,this.$emit("getHeight",t)}},watch:{offsetTop(){this.divStyle.top=this.offsetTop},offsetBottom(){this.divStyle.bottom=this.offsetBottom}},render(){return s("div",{style:[this.sectionStyle],class:"sticky"===this.mode&&h.sticky},[s("div",{ref:"div",class:["van-sticky","fixed"===this.mode?"van-sticky--fixed":"",h[this.background]],style:[this.divStyle,this.sectionStyle]},[s("div",{ref:"div2"},[this.$slots.default&&this.$slots.default()])])])}}))}}}))}();
|