primevue
Version:
[](https://opensource.org/licenses/MIT) [](https://badge.fury.io/js/primevue) [ • 3.88 kB
JavaScript
this.primevue=this.primevue||{},this.primevue.breadcrumb=function(e){"use strict";var t={name:"BreadcrumbItem",props:{item:null,template:null,exact:null},methods:{onClick(e,t){this.item.command&&this.item.command({originalEvent:e,item:this.item}),this.item.to&&t&&t(e)},containerClass(e){return[{"p-disabled":this.disabled(e)},this.item.class]},linkClass(e){return["p-menuitem-link",{"router-link-active":e&&e.isActive,"router-link-active-exact":this.exact&&e&&e.isExactActive}]},visible(){return"function"==typeof this.item.visible?this.item.visible():!1!==this.item.visible},disabled:e=>"function"==typeof e.disabled?e.disabled():e.disabled},computed:{iconClass(){return["p-menuitem-icon",this.item.icon]}}};const n={key:1,class:"p-menuitem-text"},l={key:1,class:"p-menuitem-text"};t.render=function(t,i,a,o,c,r){const m=e.resolveComponent("router-link");return r.visible()?(e.openBlock(),e.createBlock("li",{key:0,class:r.containerClass(a.item)},[a.template?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(a.template),{key:1,item:a.item},null,8,["item"])):(e.openBlock(),e.createBlock(e.Fragment,{key:0},[a.item.to?(e.openBlock(),e.createBlock(m,{key:0,to:a.item.to,custom:""},{default:e.withCtx((({navigate:t,href:l,isActive:i,isExactActive:o})=>[e.createVNode("a",{href:l,class:r.linkClass({isActive:i,isExactActive:o}),onClick:e=>r.onClick(e,t)},[a.item.icon?(e.openBlock(),e.createBlock("span",{key:0,class:r.iconClass},null,2)):e.createCommentVNode("",!0),a.item.label?(e.openBlock(),e.createBlock("span",n,e.toDisplayString(a.item.label),1)):e.createCommentVNode("",!0)],10,["href","onClick"])])),_:1},8,["to"])):(e.openBlock(),e.createBlock("a",{key:1,href:a.item.url||"#",class:r.linkClass(),onClick:i[1]||(i[1]=(...e)=>r.onClick&&r.onClick(...e)),target:a.item.target},[a.item.icon?(e.openBlock(),e.createBlock("span",{key:0,class:r.iconClass},null,2)):e.createCommentVNode("",!0),a.item.label?(e.openBlock(),e.createBlock("span",l,e.toDisplayString(a.item.label),1)):e.createCommentVNode("",!0)],10,["href","target"]))],64))],2)):e.createCommentVNode("",!0)};var i={name:"Breadcrumb",props:{model:{type:Array,default:null},home:{type:null,default:null},exact:{type:Boolean,default:!0}},components:{BreadcrumbItem:t}};const a={class:"p-breadcrumb p-component","aria-label":"Breadcrumb"},o=e.createVNode("li",{class:"p-breadcrumb-chevron pi pi-chevron-right"},null,-1);return function(e,t){void 0===t&&(t={});var n=t.insertAt;if(e&&"undefined"!=typeof document){var l=document.head||document.getElementsByTagName("head")[0],i=document.createElement("style");i.type="text/css","top"===n&&l.firstChild?l.insertBefore(i,l.firstChild):l.appendChild(i),i.styleSheet?i.styleSheet.cssText=e:i.appendChild(document.createTextNode(e))}}("\n.p-breadcrumb {\n overflow-x: auto;\n}\n.p-breadcrumb ul {\n margin: 0;\n padding: 0;\n list-style-type: none;\n display: -webkit-box;\n display: -ms-flexbox;\n display: flex;\n -webkit-box-align: center;\n -ms-flex-align: center;\n align-items: center;\n -ms-flex-wrap: nowrap;\n flex-wrap: nowrap;\n}\n.p-breadcrumb .p-menuitem-text {\n line-height: 1;\n}\n.p-breadcrumb .p-menuitem-link {\n text-decoration: none;\n}\n.p-breadcrumb::-webkit-scrollbar {\n display: none;\n}\n"),i.render=function(t,n,l,i,c,r){const m=e.resolveComponent("BreadcrumbItem");return e.openBlock(),e.createBlock("nav",a,[e.createVNode("ul",null,[l.home?(e.openBlock(),e.createBlock(m,{key:0,item:l.home,class:"p-breadcrumb-home",template:t.$slots.item,exact:l.exact},null,8,["item","template","exact"])):e.createCommentVNode("",!0),(e.openBlock(!0),e.createBlock(e.Fragment,null,e.renderList(l.model,(n=>(e.openBlock(),e.createBlock(e.Fragment,{key:n.label},[o,e.createVNode(m,{item:n,template:t.$slots.item,exact:l.exact},null,8,["item","template","exact"])],64)))),128))])])},i}(Vue);