Skip to content

Commit 382e34b

Browse files
committed
feat: deprecate new NavigationResult(to) in favor of reroute(to)
1 parent d6a3812 commit 382e34b

File tree

1 file changed

+8
-1
lines changed
  • packages/router/src/experimental

1 file changed

+8
-1
lines changed

packages/router/src/experimental/index.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,14 @@ import { NavigationResult as NavResult } from './data-loaders/entries/index'
9494
/**
9595
* @deprecated Use {@link reroute} instead.
9696
*/
97-
export const NavigationResult = NavResult
97+
export class NavigationResult extends NavResult {
98+
constructor(...args: ConstructorParameters<typeof NavResult>) {
99+
super(...args)
100+
console.warn(
101+
`[vue-router]: new NavigationResult(to) is deprecated. Use reroute(to) instead.`
102+
)
103+
}
104+
}
98105

99106
// Basic loader
100107
export {

0 commit comments

Comments
 (0)