Skip to content

Commit 2e41445

Browse files
committed
feat(warn): warn deprecated addRoutes
1 parent 92395d4 commit 2e41445

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/index.js

+4-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
import { install } from './install'
44
import { START } from './util/route'
5-
import { assert } from './util/warn'
5+
import { assert, warn } from './util/warn'
66
import { inBrowser } from './util/dom'
77
import { cleanPath } from './util/path'
88
import { createMatcher } from './create-matcher'
@@ -256,6 +256,9 @@ export default class VueRouter {
256256
}
257257

258258
addRoutes (routes: Array<RouteConfig>) {
259+
if (process.env.NODE_ENV !== 'production') {
260+
warn(false, 'router.addRoutes() is deprecated and has been removed in Vue Router 4. Use router.addRoute() instead.')
261+
}
259262
this.matcher.addRoutes(routes)
260263
if (this.history.current !== START) {
261264
this.history.transitionTo(this.history.getCurrentLocation())

0 commit comments

Comments
 (0)