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
Error is reported in "vue-router": "^4.0.0-beta.13", but it can be run in "vue-router": "3.0.6",
What is actually happening?
in "vue-router": "^4.0.0-beta.13":
Uncaught (in promise) TypeError: Cannot use 'in' operator to search for 'then' in undefined;
No match found for location with path "/system/department"
The text was updated successfully, but these errors were encountered:
@WangLucy I transferred this to vue-router-next. From the error I can tell you're passing an undefined value as one of the component properties in one of your routes.
The warning shouldn't fail though so I will adapt it
In static routing, "matched" has a value, but in dynamic routing, "matched" is empty. I found that "createrouter()" is only executed at initialization time, and does not execute this method again after logging in to get dynamic routing data【 router.addRoute () this method will not call "createrouter()" again 】, so it will issue a warning like "no match found for location with path" / xxx / xxx "every time you click the menu. Can you give me some suggestions?!
Version
3.0.0
Reproduction link
http://xujiawangzhi.com
Steps to reproduce
App.vue:
Configured dynamic routing :
const formatterRoutes = (menu, appPrefix, appName) => {
const accessedRoutes = []
menu.map(item => {
let defaultOpt = {}
let componentItem = () => import(
@/views${item.path}/index.vue
)defaultOpt = {
meta: {
title: item.menuName,
icon: item.icon,
appName,
appPrefix
},
path: item.path,
name: item.name,
...
}
if (
item.children &&
Object.prototype.toString.call(item.children === '[object Array]' && item.children.length)
) {
accessedRoutes.push({
...defaultOpt,
children: formatterRoutes(item.children,appPrefix,appName)
})
} else {
accessedRoutes.push({...defaultOpt})
}
})
return accessedRoutes
}
What is expected?
Error is reported in "vue-router": "^4.0.0-beta.13", but it can be run in "vue-router": "3.0.6",
What is actually happening?
in "vue-router": "^4.0.0-beta.13":
Uncaught (in promise) TypeError: Cannot use 'in' operator to search for 'then' in undefined;
No match found for location with path "/system/department"
The text was updated successfully, but these errors were encountered: