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

5 days ago
  1. import{H as t,J as e,K as a,L as l,O as r,M as o,aK as n,bf as s,y as i,b as c,o as f,c as u,w as d,P as b,m as _,d as h,k as g,R as p,e as y,t as v,i as m,j as k}from"./index-IX2tYR8R.js";import{_ as C}from"./u-status-bar.weuqoXTS.js";import{r as x}from"./uni-app.es.Bc5t55A8.js";import{_ as I}from"./u-icon.sW6sruaF.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 f(),u(n,{class:g(["u-navbar",[t.customClass]])},{default:d((()=>[t.fixed&&t.placeholder?(f(),u(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?(f(),u(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?(f(),u(i,{key:0,name:t.leftIcon,size:t.leftIconSize,color:t.leftIconColor},null,8,["name","size","color"])):_("",!0),t.leftText?(f(),u(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?(f(),u(n,{key:0,class:"u-navbar__content__right",onClick:o.rightClick},{default:d((()=>[p(t.$slots,"right",{},(()=>[t.rightIcon?(f(),u(i,{key:0,name:t.rightIcon,size:"20"},null,8,["name"])):_("",!0),t.rightText?(f(),u(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 _};