@@ -124,11 +124,6 @@ export default function (Vue, Router) {
124124 let prevRoute = this . _currentRoute
125125 let prevTransition = this . _currentTransition
126126
127- // abort ongoing transition
128- if ( prevTransition && path !== prevTransition . to . path ) {
129- prevTransition . aborted = true
130- }
131-
132127 // do nothing if going to the same route.
133128 // the route only changes when a transition successfully
134129 // reaches activation; we don't need to do anything
@@ -140,8 +135,9 @@ export default function (Vue, Router) {
140135
141136 // construct new route and transition context
142137 let route = new Route ( path , this )
143- let transition = this . _currentTransition =
144- new RouteTransition ( this , route , prevRoute )
138+ let transition = new RouteTransition ( this , route , prevRoute )
139+ this . _prevTransition = prevTransition
140+ this . _currentTransition = transition
145141
146142 if ( ! this . app ) {
147143 // initial render
@@ -175,15 +171,22 @@ export default function (Vue, Router) {
175171 }
176172
177173 /**
178- * Switch the current route to a new one .
174+ * Set current to the new transition .
179175 * This is called by the transition object when the
180176 * validation of a route has succeeded.
181177 *
182- * @param {Route } route
178+ * @param {RouteTransition } transition
183179 */
184180
185- Router . prototype . _updateRoute = function ( route ) {
186- this . _currentRoute = route
181+ Router . prototype . _onTransitionValidated = function ( transition ) {
182+ // now that this one is validated, we can abort
183+ // the previous transition.
184+ let prevTransition = this . _prevTransition
185+ if ( prevTransition ) {
186+ prevTransition . aborted = true
187+ }
188+ // set current route
189+ let route = this . _currentRoute = transition . to
187190 // update route context for all children
188191 if ( this . app . $route !== route ) {
189192 this . app . $route = route
0 commit comments