anchor.d0278fd6.js 952 B

1
  1. import{_ as h,d as g,v as y,c1 as C,w as b,o as c,c as u,F as k,C as T,A as E,K as A}from"./index.b2b87cd1.js";const B={fixed:"","p-5":"","text-sm":"","font-bold":""},N=["onClick"],w=g({__name:"anchor",props:{map:null},setup(i){const s=i,r=y(null),{y:o}=C(r);b(()=>{r.value=document.getElementsByClassName("el-scrollbar__wrap")[1]});function m(n){const{top:e}=s.map.get(n);r.value.scrollTo({top:Number(e)})}function v(n){let e=0,t=0;const a=[...s.map.entries()],{top:d,index:l}=s.map.get(n);return a.forEach(([D,{index:p,top:_}])=>{const f=l+1===p,x=l-1===p;f&&(e=_),x&&(t=_)}),l===0?o.value>=0&&o.value<e:o.value>t&&o.value<e&&o.value>=d}return(n,e)=>(c(),u("ul",B,[(c(!0),u(k,null,T(i.map.entries(),([t],a)=>(c(),u("li",{class:E(["hover:text-blue hover:bg-#f7f7f7 cursor-pointer duration-200ms p-1.5 m-1 rounded",{"is-active":v(t)}]),onClick:()=>m(t),key:a},A(t),11,N))),128))]))}});var I=h(w,[["__scopeId","data-v-0fe33368"]]);export{I as default};