acdr-ui/dist/build/mp-weixin/modules/mall/sheep/components/s-tabbar/s-tabbar.js

2 lines
1.4 KiB
JavaScript
Raw Normal View History

2024-10-01 09:15:35 +08:00
"use strict";const e=require("../../../../../common/vendor.js"),t=require("../../index.js");if(!Array){(e.resolveComponent("su-tabbar-item")+e.resolveComponent("su-tabbar"))()}Math||((()=>"../../ui/su-tabbar-item/su-tabbar-item.js")+(()=>"../../ui/su-tabbar/su-tabbar.js"))();const r={__name:"s-tabbar",props:{path:String,default:""},setup(r){const a=e.computed((()=>{var e;return null==(e=t.sheep.$store("app").template.basic)?void 0:e.tabbar})),o=e.computed((()=>{const e=a.value.style;return"color"===e.bgType?{background:e.bgColor}:"img"===e.bgType?{background:`url(${t.sheep.$url.cdn(e.bgImg)}) no-repeat top center / 100% auto`}:void 0})),u=t=>2===e.unref(a).mode&&(e.unref(a).items%2>0&&Math.ceil(e.unref(a).items.length/2)===t+1);return(n,l)=>{var s,c,i,b;return e.e({a:(null==(c=null==(s=a.value)?void 0:s.items)?void 0:c.length)>0},(null==(b=null==(i=a.value)?void 0:i.items)?void 0:b.length)>0?{b:e.f(a.value.items,((r,a,o)=>({a:e.unref(t.sheep).$url.cdn(r.activeIconUrl),b:e.unref(t.sheep).$url.cdn(r.iconUrl),c:r.text,d:e.o((a=>e.unref(t.sheep).$router.go(r.url)),r.text),e:"3c9c718a-1-"+o+",3c9c718a-0",f:e.p({text:r.text,name:r.url,isCenter:u(a),centerImage:e.unref(t.sheep).$url.cdn(r.iconUrl)})}))),c:e.p({value:r.path,fixed:!0,placeholder:!0,safeAreaInsetBottom:!0,inactiveColor:a.value.style.color,activeColor:a.value.style.activeColor,midTabBar:2===a.value.mode,customStyle:o.value})}:{})}}};wx.createComponent(r);