File tree Expand file tree Collapse file tree 3 files changed +16
-5
lines changed Expand file tree Collapse file tree 3 files changed +16
-5
lines changed Original file line number Diff line number Diff line change 1
1
/*!
2
- * vue-router v0.7.3
2
+ * vue-router v0.7.4
3
3
* (c) 2015 Evan You
4
4
* Released under the MIT License.
5
5
*/
@@ -166,6 +166,7 @@ return /******/ (function(modules) { // webpackBootstrap
166
166
this . _currentTransition = null ;
167
167
this . _previousTransition = null ;
168
168
this . _notFoundHandler = null ;
169
+ this . _notFoundRedirect = null ;
169
170
this . _beforeEachHooks = [ ] ;
170
171
this . _afterEachHooks = [ ] ;
171
172
@@ -413,7 +414,11 @@ return /******/ (function(modules) { // webpackBootstrap
413
414
*/
414
415
415
416
Router . prototype . _addRedirect = function _addRedirect ( path , redirectPath ) {
416
- this . _addGuard ( path , redirectPath , this . replace ) ;
417
+ if ( path === '*' ) {
418
+ this . _notFoundRedirect = redirectPath ;
419
+ } else {
420
+ this . _addGuard ( path , redirectPath , this . replace ) ;
421
+ }
417
422
} ;
418
423
419
424
/**
@@ -459,6 +464,12 @@ return /******/ (function(modules) { // webpackBootstrap
459
464
if ( matched ) {
460
465
matched [ 0 ] . handler ( matched [ 0 ] , matched . queryParams ) ;
461
466
return true ;
467
+ } else if ( this . _notFoundRedirect ) {
468
+ matched = this . _recognizer . recognize ( path ) ;
469
+ if ( ! matched ) {
470
+ this . replace ( this . _notFoundRedirect ) ;
471
+ return true ;
472
+ }
462
473
}
463
474
} ;
464
475
You can’t perform that action at this time.
0 commit comments