Closed cMing1997 closed 1 year ago
router.addRoutes([
{
path: "/",
component: LayoutView,
children: [
{
path: "home",
name: "home",
component: Home
}
]
}
]);
or without the array.
Please, next time consider using the Discord server, Discussions (if enabled in this repository), or StackOverflow for questions first. But feel free to come back and open an issue if it turns out to be a bug 🙂
Version
3.6.5
Reproduction link
codesandbox.io
Steps to reproduce
vue-router.esm.js:16 [vue-router] router.addRoutes() is deprecated and has been removed in Vue Router 4. Use router.addRoute() instead
.Uncaught Error: [vue-router] "path" is required in a route configuration
What is expected?
addRoutes and addRoute One of them is available and error-free
What is actually happening?
There is a warning prompt when using addRoutes, and an error is reported directly when using addRoute