Skip to content

Commit 3326ff5

Browse files
committed
[build] 0.7.4
1 parent 52ab5a0 commit 3326ff5

File tree

3 files changed

+16
-5
lines changed

3 files changed

+16
-5
lines changed

dist/vue-router.js

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*!
2-
* vue-router v0.7.3
2+
* vue-router v0.7.4
33
* (c) 2015 Evan You
44
* Released under the MIT License.
55
*/
@@ -166,6 +166,7 @@ return /******/ (function(modules) { // webpackBootstrap
166166
this._currentTransition = null;
167167
this._previousTransition = null;
168168
this._notFoundHandler = null;
169+
this._notFoundRedirect = null;
169170
this._beforeEachHooks = [];
170171
this._afterEachHooks = [];
171172

@@ -413,7 +414,11 @@ return /******/ (function(modules) { // webpackBootstrap
413414
*/
414415

415416
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+
}
417422
};
418423

419424
/**
@@ -459,6 +464,12 @@ return /******/ (function(modules) { // webpackBootstrap
459464
if (matched) {
460465
matched[0].handler(matched[0], matched.queryParams);
461466
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+
}
462473
}
463474
};
464475

0 commit comments

Comments
 (0)