u-tabbar.js 1.3 KB
"use strict";const e=require("./props.js"),t=require("../../libs/mixin/mpMixin.js"),i=require("../../libs/mixin/mixin.js"),r=require("../../libs/function/index.js"),a=require("../../../../common/vendor.js"),o={name:"u-tabbar",mixins:[t.mpMixin,i.mixin,e.props],data:()=>({placeholderHeight:0}),computed:{tabbarStyle(){const e={zIndex:this.zIndex};return r.deepMerge(e,r.addStyle(this.customStyle))},updateChild(){return[this.value,this.activeColor,this.inactiveColor]},updatePlaceholder(){return[this.fixed,this.placeholder]}},watch:{updateChild(){this.updateChildren()},updatePlaceholder(){this.setPlaceholderHeight()}},created(){this.children=[]},mounted(){this.setPlaceholderHeight()},methods:{updateChildren(){this.children.length&&this.children.map((e=>e.updateFromParent()))},async setPlaceholderHeight(){this.fixed&&this.placeholder&&(await r.sleep(20),this.$uGetRect(".u-tabbar__content").then((({height:e=50})=>{this.placeholderHeight=e})))}}};if(!Array){a.resolveComponent("u-safe-bottom")()}Math;const d=a._export_sfc(o,[["render",function(e,t,i,r,o,d){return a.e({a:e.safeAreaInsetBottom},(e.safeAreaInsetBottom,{}),{b:a.o(((...t)=>e.noop&&e.noop(...t))),c:a.n(e.border&&"u-border-top"),d:a.n(e.fixed&&"u-tabbar--fixed"),e:a.s(d.tabbarStyle),f:e.placeholder},e.placeholder?{g:o.placeholderHeight+"px"}:{})}],["__scopeId","data-v-1cfd0c42"]]);wx.createComponent(d);