You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

1 line
3.3 KiB

1 week ago
  1. import{D as t,E as e,G as a,H as l,L as r,J as o,aH as n,aM as s,y as i,b as c,o as u,c as f,w as d,M as b,m as _,d as h,k as g,O as p,e as y,t as v,i as m,j as k}from"./index-DkGewvWo.js";import{_ as C}from"./u-status-bar.DDNs5qwz.js";import{r as x}from"./uni-app.es.Bo01BzMV.js";import{_ as I}from"./u-icon.x7ElsZU9.js";import{_ as S}from"./_plugin-vue_export-helper.BCo6x5W8.js";const T=S({name:"u-navbar",mixins:[a,l,t({props:{safeAreaInsetTop:{type:Boolean,default:()=>e.navbar.safeAreaInsetTop},placeholder:{type:Boolean,default:()=>e.navbar.placeholder},fixed:{type:Boolean,default:()=>e.navbar.fixed},border:{type:Boolean,default:()=>e.navbar.border},leftIcon:{type:String,default:()=>e.navbar.leftIcon},leftText:{type:String,default:()=>e.navbar.leftText},rightText:{type:String,default:()=>e.navbar.rightText},rightIcon:{type:String,default:()=>e.navbar.rightIcon},title:{type:[String,Number],default:()=>e.navbar.title},bgColor:{type:String,default:()=>e.navbar.bgColor},titleWidth:{type:[String,Number],default:()=>e.navbar.titleWidth},height:{type:[String,Number],default:()=>e.navbar.height},leftIconSize:{type:[String,Number],default:()=>e.navbar.leftIconSize},leftIconColor:{type:String,default:()=>e.navbar.leftIconColor},autoBack:{type:Boolean,default:()=>e.navbar.autoBack},titleStyle:{type:[String,Object],default:()=>e.navbar.titleStyle}}})],data:()=>({}),emits:["leftClick","rightClick"],methods:{addStyle:r,addUnit:o,sys:n,getPx:s,leftClick(){this.$emit("leftClick"),this.autoBack&&i()},rightClick(){this.$emit("rightClick")}}},[["render",function(t,e,a,l,r,o){const n=m,s=x(c("u-status-bar"),C),i=x(c("u-icon"),I),S=k;return u(),f(n,{class:g(["u-navbar",[t.customClass]])},{default:d((()=>[t.fixed&&t.placeholder?(u(),f(n,{key:0,class:"u-navbar__placeholder",style:b({height:o.addUnit(o.getPx(t.height)+o.sys().statusBarHeight,"px")})},null,8,["style"])):_("",!0),h(n,{class:g([t.fixed&&"u-navbar--fixed"])},{default:d((()=>[t.safeAreaInsetTop?(u(),f(s,{key:0,bgColor:t.bgColor},null,8,["bgColor"])):_("",!0),h(n,{class:g(["u-navbar__content",[t.border&&"u-border-bottom"]]),style:b({height:o.addUnit(t.height),backgroundColor:t.bgColor})},{default:d((()=>[h(n,{class:"u-navbar__content__left","hover-class":"u-navbar__content__left--hover","hover-start-time":"150",onClick:o.leftClick},{default:d((()=>[p(t.$slots,"left",{},(()=>[t.leftIcon?(u(),f(i,{key:0,name:t.leftIcon,size:t.leftIconSize,color:t.leftIconColor},null,8,["name","size","color"])):_("",!0),t.leftText?(u(),f(S,{key:1,style:b({color:t.leftIconColor}),class:"u-navbar__content__left__text"},{default:d((()=>[y(v(t.leftText),1)])),_:1},8,["style"])):_("",!0)]),!0)])),_:3},8,["onClick"]),p(t.$slots,"center",{},(()=>[h(S,{class:"u-line-1 u-navbar__content__title",style:b([{width:o.addUnit(t.titleWidth)},o.addStyle(t.titleStyle)])},{default:d((()=>[y(v(t.title),1)])),_:1},8,["style"])]),!0),t.$slots.right||t.rightIcon||t.rightText?(u(),f(n,{key:0,class:"u-navbar__content__right",onClick:o.rightClick},{default:d((()=>[p(t.$slots,"right",{},(()=>[t.rightIcon?(u(),f(i,{key:0,name:t.rightIcon,size:"20"},null,8,["name"])):_("",!0),t.rightText?(u(),f(S,{key:1,class:"u-navbar__content__right__text"},{default:d((()=>[y(v(t.rightText),1)])),_:1})):_("",!0)]),!0)])),_:3},8,["onClick"])):_("",!0)])),_:3},8,["class","style"])])),_:3},8,["class"])])),_:3},8,["class"])}],["__scopeId","data-v-69090fcb"]]);export{T as _};