Skip to content

Commit 88113e7

Browse files
committed
support object format in redirect
1 parent 42d12b9 commit 88113e7

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/transition.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,12 @@ export default class RouteTransition {
6767
redirect (path) {
6868
if (!this.aborted) {
6969
this.aborted = true
70-
path = mapParams(path, this.to.params, this.to.query)
70+
if (typeof path === 'string') {
71+
path = mapParams(path, this.to.params, this.to.query)
72+
} else {
73+
path.params = this.to.params
74+
path.query = this.to.query
75+
}
7176
this.router.replace(path)
7277
}
7378
}

0 commit comments

Comments
 (0)