routeTabs-00a65ebb.js 693 B

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