File tree Expand file tree Collapse file tree 3 files changed +22
-6
lines changed Expand file tree Collapse file tree 3 files changed +22
-6
lines changed Original file line number Diff line number Diff line change @@ -194,22 +194,33 @@ module.exports = function (Vue, Router) {
194
194
}
195
195
196
196
/**
197
- * Handle stuff after the transition.
197
+ * Switch the current route to a new one.
198
+ * This is called by the transition object when the
199
+ * validation of a route has succeeded.
198
200
*
199
201
* @param {Route } route
200
- * @param {Object } [state]
201
- * @param {String } [anchor]
202
202
*/
203
203
204
- p . _postTransition = function ( route , state , anchor ) {
204
+ p . _updateRoute = function ( route ) {
205
+ this . _currentRoute = route
205
206
// update route context for all children
206
207
if ( this . app . $route !== route ) {
207
208
this . app . $route = route
208
209
this . _children . forEach ( function ( child ) {
209
210
child . $route = route
210
211
} )
211
212
}
213
+ }
214
+
215
+ /**
216
+ * Handle stuff after the transition.
217
+ *
218
+ * @param {Route } route
219
+ * @param {Object } [state]
220
+ * @param {String } [anchor]
221
+ */
212
222
223
+ p . _postTransition = function ( route , state , anchor ) {
213
224
// handle scroll positions
214
225
// saved scroll positions take priority
215
226
// then we check if the path has an anchor
Original file line number Diff line number Diff line change @@ -123,12 +123,16 @@ p.start = function (cb) {
123
123
transition . runQueue ( daq , pipeline . canDeactivate , function canActivatePhase ( ) {
124
124
transition . runQueue ( aq , pipeline . canActivate , function deactivatePhase ( ) {
125
125
transition . runQueue ( daq , pipeline . deactivate , function activatePhase ( ) {
126
- // validation complete. change the current route.
127
- transition . router . _currentRoute = transition . to
126
+ // Validation phase is now over! The new route is valid.
127
+
128
+ // Update router current route
129
+ transition . router . _updateRoute ( transition . to )
130
+
128
131
// trigger reuse for all reused views
129
132
reuseQueue && reuseQueue . forEach ( function ( view ) {
130
133
pipeline . reuse ( view , transition )
131
134
} )
135
+
132
136
// the root of the chain that needs to be replaced
133
137
// is the top-most non-reusable view.
134
138
if ( daq . length ) {
Original file line number Diff line number Diff line change 5
5
},
6
6
7
7
"globals": {
8
+ "isIE": true,
8
9
"isIE9": true,
9
10
"jasmine": true,
10
11
"describe": true,
You can’t perform that action at this time.
0 commit comments