index.a0b72ee6.js 1.3 KB

1
  1. import{j as a,G as I,H as k,I as A,d as C,V as P,af as w,aZ as s,a_ as R,O as N,P as S}from"./index.c8a33855.js";import{u as b}from"./use-height.f274d759.js";function y(e,l){const t=b(e);return i=>a("div",{class:l("placeholder"),style:{height:t.value?`${t.value}px`:void 0}},[i()])}const[O,r]=I("nav-bar"),_={title:String,fixed:Boolean,zIndex:k,border:A,leftText:String,rightText:String,leftArrow:Boolean,placeholder:Boolean,safeAreaInsetTop:Boolean};var E=C({name:O,props:_,emits:["click-left","click-right"],setup(e,{emit:l,slots:t}){const i=P(),o=y(i,r),f=n=>l("click-left",n),d=n=>l("click-right",n),h=()=>t.left?t.left():[e.leftArrow&&a(N,{class:r("arrow"),name:"arrow-left"},null),e.leftText&&a("span",{class:r("text")},[e.leftText])],u=()=>t.right?t.right():a("span",{class:r("text")},[e.rightText]),c=()=>{const{title:n,fixed:g,border:v,zIndex:x}=e,T=w(x),B=e.leftArrow||e.leftText||t.left,m=e.rightText||t.right;return a("div",{ref:i,style:T,class:[r({fixed:g}),{[R]:v,"van-safe-area-top":e.safeAreaInsetTop}]},[a("div",{class:r("content")},[B&&a("div",{class:[r("left"),s],onClick:f},[h()]),a("div",{class:[r("title"),"van-ellipsis"]},[t.title?t.title():n]),m&&a("div",{class:[r("right"),s],onClick:d},[u()])])])};return()=>e.fixed&&e.placeholder?o(c):c()}});const z=S(E);export{z as N};