index.1d5c6f70.js 1.1 KB

1
  1. import{t as m,z as I,v as s,d as b,R as A,aX as C,aU as w,c as r,ay as o,aY as P,a5 as L,D as N}from"./index.ffe80dbe.js";const[S,t]=m("nav-bar"),y={title:String,fixed:Boolean,zIndex:I,border:s,leftText:String,rightText:String,leftArrow:Boolean,placeholder:Boolean,safeAreaInsetTop:Boolean,clickable:s};var z=b({name:S,props:y,emits:["clickLeft","clickRight"],setup(e,{emit:l,slots:a}){const c=A(),f=C(c,t),d=n=>l("clickLeft",n),h=n=>l("clickRight",n),g=()=>a.left?a.left():[e.leftArrow&&r(L,{class:t("arrow"),name:"arrow-left"},null),e.leftText&&r("span",{class:t("text")},[e.leftText])],x=()=>a.right?a.right():r("span",{class:t("text")},[e.rightText]),i=()=>{const{title:n,fixed:u,border:v,zIndex:T}=e,k=w(T),B=e.leftArrow||e.leftText||a.left,R=e.rightText||a.right;return r("div",{ref:c,style:k,class:[t({fixed:u}),{[P]:v,"van-safe-area-top":e.safeAreaInsetTop}]},[r("div",{class:t("content")},[B&&r("div",{class:[t("left"),e.clickable?o:""],onClick:d},[g()]),r("div",{class:[t("title"),"van-ellipsis"]},[a.title?a.title():n]),R&&r("div",{class:[t("right"),e.clickable?o:""],onClick:h},[x()])])])};return()=>e.fixed&&e.placeholder?f(i):i()}});const E=N(z);export{E as N};