routeTabs-ccc3c29b.js 614 B

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