12 |
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/subItem.BRNib855.js","assets/vue.YrNK8sx4.js","assets/index.IRF5Ik0K.js","assets/index.I-CrZeUC.css"])))=>i.map(i=>d[i]);
- import{au as E,u as P,_ as V,o as N,e as O}from"./index.IRF5Ik0K.js";import{a as R,r as j,aC as h,aB as q,_ as F,f as J,a5 as Y,q as K,aJ as Q,aj as i,c as m,o as r,S as a,K as l,R as k,a9 as U,J as C,u as W,aA as G,b as L,Q as d,a8 as X,P as S,Y as y,t as Z}from"./vue.YrNK8sx4.js";import{f as ee}from"./routeFilter.CCAbkObw.js";import{_ as te}from"./_plugin-vue_export-helper.DlAUqK2U.js";const ne={class:"el-menu-horizontal-warp"},se=["onClick"],oe=R({name:"navMenuHorizontal"}),ae=R({...oe,props:{menuList:{type:Array,default:()=>[]}},setup(g){const A=G(()=>V(()=>import("./subItem.BRNib855.js"),__vite__mapDeps([0,1,2,3]))),b=g,c=j(),M=E(),$=P(),{routesList:w}=h(M),{themeConfig:p}=h($),z=q(),u=F({defaultActive:""}),v=J(()=>b.menuList),x=e=>{const s=e.wheelDelta||-e.deltaY*40;c.value.$refs.wrapRef.scrollLeft=c.value.$refs.wrapRef.scrollLeft+s/4},B=()=>{Z(()=>{let e=document.querySelector(".el-menu.el-menu--horizontal li.is-active");if(!e)return!1;c.value.$refs.wrapRef.scrollLeft=e.offsetLeft})},D=e=>{const s=e.split("/");let t={children:[]};return ee(w.value).map((o,f)=>{o.path===`/${s[1]}`&&(o.k=f,t.item={...o},t.children=[{...o}],o.children&&(t.children=o.children))}),t},_=e=>{const{path:s,meta:t}=e;if(p.value.layout==="classic")u.defaultActive=`/${s==null?void 0:s.split("/")[1]}`;else{const o=t!=null&&t.isDynamic?t.isDynamicPath.split("/"):s.split("/");o.length>=4&&(t!=null&&t.isHide)?u.defaultActive=o.splice(0,3).join("/"):u.defaultActive=s}},H=e=>{N.handleOpenLink(e)};return Y(()=>{_(z)}),K(()=>{B()}),Q(e=>{_(e);let{layout:s,isClassicSplitMenu:t}=p.value;s==="classic"&&t&&O.emit("setSendClassicChildren",D(e.path))}),(e,s)=>{const t=i("SvgIcon"),o=i("el-sub-menu"),f=i("el-menu-item"),I=i("el-menu"),T=i("el-scrollbar");return r(),m("div",ne,[a(T,{onWheel:y(x,["prevent"]),ref_key:"elMenuHorizontalScrollbarRef",ref:c},{default:l(()=>[a(I,{router:"","default-active":u.defaultActive,ellipsis:!1,"background-color":"transparent",mode:"horizontal"},{default:l(()=>[(r(!0),m(k,null,U(v.value,n=>(r(),m(k,null,[n.children&&n.children.length>0?(r(),C(o,{index:n.path,key:n.path},{title:l(()=>[a(t,{name:n.meta.icon},null,8,["name"]),L("span",null,d(e.$t(n.meta.title)),1)]),default:l(()=>[a(W(A),{chil:n.children},null,8,["chil"])]),_:2},1032,["index"])):(r(),C(f,{index:n.path,key:n.path},X({_:2},[!n.meta.isLink||n.meta.isLink&&n.meta.isIframe?{name:"title",fn:l(()=>[a(t,{name:n.meta.icon},null,8,["name"]),S(" "+d(e.$t(n.meta.title)),1)]),key:"0"}:{name:"title",fn:l(()=>[L("a",{class:"w100",onClick:y(le=>H(n),["prevent"])},[a(t,{name:n.meta.icon},null,8,["name"]),S(" "+d(e.$t(n.meta.title)),1)],8,se)]),key:"1"}]),1032,["index"]))],64))),256))]),_:1},8,["default-active"])]),_:1},512)])}}}),fe=te(ae,[["__scopeId","data-v-c3d744c0"]]);export{fe as default};
|