index.d8c651bf.js 1.3 KB

1
  1. import{j as a,A as k,E as A,G as I,d as C,S as w,ad as N,aX as s,aY as P,M as R,N as S}from"./index.e6d6174e.js";import{u as b}from"./use-height.8140ea04.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[E,r]=k("nav-bar"),L={title:String,fixed:Boolean,zIndex:A,border:I,leftText:String,rightText:String,leftArrow:Boolean,placeholder:Boolean,safeAreaInsetTop:Boolean};var O=C({name:E,props:L,emits:["click-left","click-right"],setup(e,{emit:l,slots:t}){const i=w(),o=y(i,r),f=n=>l("click-left",n),d=n=>l("click-right",n),h=()=>t.left?t.left():[e.leftArrow&&a(R,{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=N(x),B=e.leftArrow||e.leftText||t.left,m=e.rightText||t.right;return a("div",{ref:i,style:T,class:[r({fixed:g}),{[P]: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 D=S(O);export{D as N};