Htabs-eb04e3b8.js 584 B

1
  1. import{k as i,r}from"./index-a7633adc.js";const u=i("routeTabs",{state:()=>({historyRoutes:[],activeKey:0}),persist:{enabled:!0,strategies:[{storage:localStorage,paths:["historyRoutes","activeKey"]}]},getters:{},actions:{saveRoute(e){if(!this.historyRoutes.some(o=>o.name==e.name))return this.historyRoutes.push(e)},delRoute(e,s){if(r.options.routes[1].children.forEach(t=>{t.name==e&&(t.keepAlive=!1)}),this.historyRoutes=this.historyRoutes.filter(t=>{if(t.name!==e)return t}),e==s&&this.historyRoutes.length>0)return r.replace({name:this.historyRoutes[0].meta.name})}}});export{u};