兰宝车间质量管理系统-前端
疯狂的狮子li
2023-04-06 ccbe849103c9626d20d998805386349fd61f4e40
update 关闭页签后存在其他页签时不应该跳转首页
已修改1个文件
8 ■■■■ 文件已修改
src/plugins/tab.ts 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/plugins/tab.ts
@@ -33,8 +33,12 @@
  async closePage(obj?: TagView): Promise<{ visitedViews: TagView[]; cachedViews: string[] } | any> {
    if (obj === undefined) {
      // prettier-ignore
      const { lastPath } = await useTagsViewStore().delView(router.currentRoute.value) as any
      return router.push(lastPath || '/index');
      const { visitedViews } = await useTagsViewStore().delView(router.currentRoute.value) as any
      const latestView = visitedViews.slice(-1)[0]
      if (latestView) {
        return router.push(latestView.fullPath)
      }
      return router.push('/');
    }
    return useTagsViewStore().delView(obj);
  },