import{_ as a,bq as t,aK as e,n as r,o as s,p as n,w as o,f as u,a4 as i,aq as l,e as d,k as c,t as p,i as m,C as f,b,d as _,y as g,F as h}from"./index-2PZN6pGH.js";import{_ as y}from"./uni-card.CpdfOoXJ.js";import{_ as v}from"./uni-section.BISPxi99.js";const k=a({data:()=>({currentPage:""}),options:{virtualHost:!0},props:{to:{type:String,default:""},replace:{type:Boolean,default:!1}},inject:{uniBreadcrumb:{from:"uniBreadcrumb",default:null}},created(){const a=t(),e=a[a.length-1];e&&(this.currentPage=`/${e.route}`)},computed:{separator(){return this.uniBreadcrumb.separator},separatorClass(){return this.uniBreadcrumb.separatorClass}},methods:{navTo(){const{to:a}=this;a&&this.currentPage!==a&&(this.replace?e({url:a}):r({url:a}))}}},[["render",function(a,t,e,r,b,_){const g=m,h=f;return s(),n(g,{class:"uni-breadcrumb-item"},{default:o((()=>[u(g,{class:i({"uni-breadcrumb-item--slot":!0,"uni-breadcrumb-item--slot-link":e.to&&b.currentPage!==e.to}),onClick:_.navTo},{default:o((()=>[l(a.$slots,"default",{},void 0,!0)])),_:3},8,["class","onClick"]),_.separatorClass?(s(),d("i",{key:0,class:i(["uni-breadcrumb-item--separator",_.separatorClass])},null,2)):(s(),n(h,{key:1,class:"uni-breadcrumb-item--separator"},{default:o((()=>[c(p(_.separator),1)])),_:1}))])),_:3})}],["__scopeId","data-v-cdf21a5f"]]);const C=a({options:{virtualHost:!0},props:{separator:{type:String,default:"/"},separatorClass:{type:String,default:""}},provide(){return{uniBreadcrumb:this}}},[["render",function(a,t,e,r,u,i){const d=m;return s(),n(d,{class:"uni-breadcrumb"},{default:o((()=>[l(a.$slots,"default",{},void 0,!0)])),_:3})}],["__scopeId","data-v-fd9c4191"]]);const B=a({components:{},data:()=>({routes:[{to:"/pages/index/index",name:"首页"},{to:"",name:"菜单 A"},{to:"",name:"菜单 B"}]})},[["render",function(a,t,e,r,i,l){const B=f,j=b(_("uni-card"),y),x=b(_("uni-breadcrumb-item"),k),P=b(_("uni-breadcrumb"),C),q=b(_("uni-section"),v),S=m;return s(),n(S,{class:"container"},{default:o((()=>[u(j,{"is-full":"","is-shadow":!1},{default:o((()=>[u(B,{class:"uni-h6"},{default:o((()=>[c("面包屑导航显示当前页面的路径，快速返回之前的任意可跳转页面")])),_:1})])),_:1}),u(q,{title:"基础用法",type:"line",padding:""},{default:o((()=>[u(P,{separator:"/"},{default:o((()=>[(s(!0),d(h,null,g(i.routes,((a,t)=>(s(),n(x,{key:t,to:a.to},{default:o((()=>[c(p(a.name),1)])),_:2},1032,["to"])))),128))])),_:1})])),_:1}),u(q,{title:"自定义分隔符",type:"line",padding:""},{default:o((()=>[u(P,{separator:">"},{default:o((()=>[(s(!0),d(h,null,g(i.routes,((a,t)=>(s(),n(x,{key:t,to:a.to},{default:o((()=>[c(p(a.name),1)])),_:2},1032,["to"])))),128))])),_:1})])),_:1})])),_:1})}]]);export{B as default};
