You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Aug 28, 2024. It is now read-only.
node -v
v18.18.2
pnpm -v
9.1.2
windows 10
pnpm dev
选择 admin
跳转路由报错:
Cannot destructure property 'currentRoute' of 'useRouter(...)' as it is undefined.
pnpm build
选 admin
Cannot destructure property 'currentRoute' of 'useRouter(...)' as it is undefined.
临时解决
--- a/packages/stores/src/modules/multipleTab.ts+++ b/packages/stores/src/modules/multipleTab.ts@@ -1,5 +1,5 @@
import { defineStore } from 'pinia'
-import { toRaw, unref } from 'vue'+import { computed, toRaw, unref } from 'vue'
import {
PAGE_NOT_FOUND_NAME,
PageEnum,
@@ -14,6 +14,8 @@ import type {
import { getRawRoute, RemovableRef } from '@vben/utils'
import { useRouter } from 'vue-router'
+const currentRoute = computed(() => useRouter())+
function handleGotoPage(router: Router, route?: RouteLocationNormalized) {
const currentPath = unref(router.currentRoute).path
// check if current route in tablist
@@ -391,7 +393,6 @@ export const useMultipleTab = defineStore({
getTabActions(tabItem: RouteLocationNormalized) {
if (!tabItem) return
const { meta } = tabItem
- const { currentRoute } = useRouter()
const { path } = unref(currentRoute)
const isCurItem = tabItem ? tabItem.path === path : false
F:\vben3>
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
新clone下来的代码,使用pnpm install安装好依赖之后,执行pnpm dev 报错。报错图片如下:
The text was updated successfully, but these errors were encountered: