niucloud-admin/niucloud/public/wap/assets/u-tabbar.2c7ab03f.js
全栈小学生 af883ac9e1 update
2024-08-06 17:54:17 +08:00

2 lines
2.1 KiB
JavaScript

import{m as e,p as t,q as a,x as r,y as o,b1 as l,g as s,h as d,o as i,c as n,w as h,b as u,B as b,C as c,n as p,D as f,f as m,i as _}from"./index-3788e709.js";import{_ as y}from"./u-safe-bottom.c1110952.js";import{_ as v}from"./_plugin-vue_export-helper.1b428a4d.js";const x=v({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 r(e,o(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 l(20),this.$uGetRect(".u-tabbar__content").then((({height:e=50})=>{this.placeholderHeight=e})))}}},[["render",function(e,t,a,r,o,l){const v=_,x=s(d("u-safe-bottom"),y);return i(),n(v,{class:"u-tabbar"},{default:h((()=>[u(v,{class:b(["u-tabbar__content",[e.border&&"u-border-top",e.fixed&&"u-tabbar--fixed"]]),ref:"u-tabbar__content",onTouchmove:c(e.noop,["stop","prevent"]),style:p([l.tabbarStyle])},{default:h((()=>[u(v,{class:"u-tabbar__content__item-wrapper"},{default:h((()=>[f(e.$slots,"default",{},void 0,!0)])),_:3}),e.safeAreaInsetBottom?(i(),n(x,{key:0})):m("v-if",!0)])),_:3},8,["onTouchmove","class","style"]),e.placeholder?(i(),n(v,{key:0,class:"u-tabbar__placeholder",style:p({height:o.placeholderHeight+"px"})},null,8,["style"])):m("v-if",!0)])),_:3})}],["__scopeId","data-v-71f6d5da"]]);export{x as _};