mirror of
https://gitee.com/niucloud-team/niucloud-admin.git
synced 2026-01-06 04:58:10 +00:00
2 lines
2.1 KiB
JavaScript
2 lines
2.1 KiB
JavaScript
import{A as e,B as t,C as a,q as r,t as o,i as l,j as s,w as i,k as d,D as n,E as u,p as h,F as c,m as p,x as b}from"./index-faf5e276.js";import{_ as f}from"./u-safe-bottom.c1f1e254.js";import{_ as m}from"./_plugin-vue_export-helper.1b428a4d.js";const _=m({name:"u-tabbar",mixins:[t,a,{props:{value:{type:[String,Number,null],default:e.tabbar.value},safeAreaInsetBottom:{type:Boolean,default:e.tabbar.safeAreaInsetBottom},border:{type:Boolean,default:e.tabbar.border},zIndex:{type:[String,Number],default:e.tabbar.zIndex},activeColor:{type:String,default:e.tabbar.activeColor},inactiveColor:{type:String,default:e.tabbar.inactiveColor},fixed:{type:Boolean,default:e.tabbar.fixed},placeholder:{type:Boolean,default:e.tabbar.placeholder}}}],data:()=>({placeholderHeight:0}),computed:{tabbarStyle(){const e={zIndex:this.zIndex};return uni.$u.deepMerge(e,uni.$u.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 uni.$u.sleep(20),this.$uGetRect(".u-tabbar__content").then((({height:e=50})=>{this.placeholderHeight=e})))}}},[["render",function(e,t,a,m,_,y){const v=b,x=r(o("u-safe-bottom"),f);return l(),s(v,{class:"u-tabbar"},{default:i((()=>[d(v,{class:n(["u-tabbar__content",[e.border&&"u-border-top",e.fixed&&"u-tabbar--fixed"]]),ref:"u-tabbar__content",onTouchmove:u(e.noop,["stop","prevent"]),style:h([y.tabbarStyle])},{default:i((()=>[d(v,{class:"u-tabbar__content__item-wrapper"},{default:i((()=>[c(e.$slots,"default",{},void 0,!0)])),_:3}),e.safeAreaInsetBottom?(l(),s(x,{key:0})):p("v-if",!0)])),_:3},8,["onTouchmove","class","style"]),e.placeholder?(l(),s(v,{key:0,class:"u-tabbar__placeholder",style:h({height:_.placeholderHeight+"px"})},null,8,["style"])):p("v-if",!0)])),_:3})}],["__scopeId","data-v-b564ac71"]]);export{_};
|