Skip to content

Commit e50e29e

Browse files
committed
chore(build): 3.0.3
1 parent f9da191 commit e50e29e

File tree

4 files changed

+63
-30
lines changed

4 files changed

+63
-30
lines changed

dist/vue-router.common.js

+20-9
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*!
2-
* vue-router v3.0.2
3-
* (c) 2018 Evan You
2+
* vue-router v3.0.3
3+
* (c) 2019 Evan You
44
* @license MIT
55
*/
66
'use strict';
@@ -1084,16 +1084,24 @@ function fillParams (
10841084
params,
10851085
routeMsg
10861086
) {
1087+
params = params || {};
10871088
try {
10881089
var filler =
10891090
regexpCompileCache[path] ||
10901091
(regexpCompileCache[path] = pathToRegexp_1.compile(path));
1091-
return filler(params || {}, { pretty: true })
1092+
1093+
// Fix #2505 resolving asterisk routes { name: 'not-found', params: { pathMatch: '/not-found' }}
1094+
if (params.pathMatch) { params[0] = params.pathMatch; }
1095+
1096+
return filler(params, { pretty: true })
10921097
} catch (e) {
10931098
if (process.env.NODE_ENV !== 'production') {
10941099
warn(false, ("missing param for " + routeMsg + ": " + (e.message)));
10951100
}
10961101
return ''
1102+
} finally {
1103+
// delete the 0 if it was added
1104+
delete params[0];
10971105
}
10981106
}
10991107

@@ -1272,8 +1280,10 @@ function normalizeLocation (
12721280
) {
12731281
var next = typeof raw === 'string' ? { path: raw } : raw;
12741282
// named target
1275-
if (next.name || next._normalized) {
1283+
if (next._normalized) {
12761284
return next
1285+
} else if (next.name) {
1286+
return extend({}, raw)
12771287
}
12781288

12791289
// relative params
@@ -2130,7 +2140,7 @@ function poll (
21302140

21312141
/* */
21322142

2133-
var HTML5History = (function (History$$1) {
2143+
var HTML5History = /*@__PURE__*/(function (History$$1) {
21342144
function HTML5History (router, base) {
21352145
var this$1 = this;
21362146

@@ -2218,7 +2228,7 @@ function getLocation (base) {
22182228

22192229
/* */
22202230

2221-
var HashHistory = (function (History$$1) {
2231+
var HashHistory = /*@__PURE__*/(function (History$$1) {
22222232
function HashHistory (router, base, fallback) {
22232233
History$$1.call(this, router, base);
22242234
// check history fallback deeplinking
@@ -2355,7 +2365,7 @@ function replaceHash (path) {
23552365

23562366
/* */
23572367

2358-
var AbstractHistory = (function (History$$1) {
2368+
var AbstractHistory = /*@__PURE__*/(function (History$$1) {
23592369
function AbstractHistory (router, base) {
23602370
History$$1.call(this, router, base);
23612371
this.stack = [];
@@ -2568,9 +2578,10 @@ VueRouter.prototype.resolve = function resolve (
25682578
current,
25692579
append
25702580
) {
2581+
current = current || this.history.current;
25712582
var location = normalizeLocation(
25722583
to,
2573-
current || this.history.current,
2584+
current,
25742585
append,
25752586
this
25762587
);
@@ -2611,7 +2622,7 @@ function createHref (base, fullPath, mode) {
26112622
}
26122623

26132624
VueRouter.install = install;
2614-
VueRouter.version = '3.0.2';
2625+
VueRouter.version = '3.0.3';
26152626

26162627
if (inBrowser && window.Vue) {
26172628
window.Vue.use(VueRouter);

dist/vue-router.esm.js

+20-9
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*!
2-
* vue-router v3.0.2
3-
* (c) 2018 Evan You
2+
* vue-router v3.0.3
3+
* (c) 2019 Evan You
44
* @license MIT
55
*/
66
/* */
@@ -1082,16 +1082,24 @@ function fillParams (
10821082
params,
10831083
routeMsg
10841084
) {
1085+
params = params || {};
10851086
try {
10861087
var filler =
10871088
regexpCompileCache[path] ||
10881089
(regexpCompileCache[path] = pathToRegexp_1.compile(path));
1089-
return filler(params || {}, { pretty: true })
1090+
1091+
// Fix #2505 resolving asterisk routes { name: 'not-found', params: { pathMatch: '/not-found' }}
1092+
if (params.pathMatch) { params[0] = params.pathMatch; }
1093+
1094+
return filler(params, { pretty: true })
10901095
} catch (e) {
10911096
if (process.env.NODE_ENV !== 'production') {
10921097
warn(false, ("missing param for " + routeMsg + ": " + (e.message)));
10931098
}
10941099
return ''
1100+
} finally {
1101+
// delete the 0 if it was added
1102+
delete params[0];
10951103
}
10961104
}
10971105

@@ -1270,8 +1278,10 @@ function normalizeLocation (
12701278
) {
12711279
var next = typeof raw === 'string' ? { path: raw } : raw;
12721280
// named target
1273-
if (next.name || next._normalized) {
1281+
if (next._normalized) {
12741282
return next
1283+
} else if (next.name) {
1284+
return extend({}, raw)
12751285
}
12761286

12771287
// relative params
@@ -2128,7 +2138,7 @@ function poll (
21282138

21292139
/* */
21302140

2131-
var HTML5History = (function (History$$1) {
2141+
var HTML5History = /*@__PURE__*/(function (History$$1) {
21322142
function HTML5History (router, base) {
21332143
var this$1 = this;
21342144

@@ -2216,7 +2226,7 @@ function getLocation (base) {
22162226

22172227
/* */
22182228

2219-
var HashHistory = (function (History$$1) {
2229+
var HashHistory = /*@__PURE__*/(function (History$$1) {
22202230
function HashHistory (router, base, fallback) {
22212231
History$$1.call(this, router, base);
22222232
// check history fallback deeplinking
@@ -2353,7 +2363,7 @@ function replaceHash (path) {
23532363

23542364
/* */
23552365

2356-
var AbstractHistory = (function (History$$1) {
2366+
var AbstractHistory = /*@__PURE__*/(function (History$$1) {
23572367
function AbstractHistory (router, base) {
23582368
History$$1.call(this, router, base);
23592369
this.stack = [];
@@ -2566,9 +2576,10 @@ VueRouter.prototype.resolve = function resolve (
25662576
current,
25672577
append
25682578
) {
2579+
current = current || this.history.current;
25692580
var location = normalizeLocation(
25702581
to,
2571-
current || this.history.current,
2582+
current,
25722583
append,
25732584
this
25742585
);
@@ -2609,7 +2620,7 @@ function createHref (base, fullPath, mode) {
26092620
}
26102621

26112622
VueRouter.install = install;
2612-
VueRouter.version = '3.0.2';
2623+
VueRouter.version = '3.0.3';
26132624

26142625
if (inBrowser && window.Vue) {
26152626
window.Vue.use(VueRouter);

dist/vue-router.js

+20-9
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*!
2-
* vue-router v3.0.2
3-
* (c) 2018 Evan You
2+
* vue-router v3.0.3
3+
* (c) 2019 Evan You
44
* @license MIT
55
*/
66
(function (global, factory) {
@@ -1088,16 +1088,24 @@ function fillParams (
10881088
params,
10891089
routeMsg
10901090
) {
1091+
params = params || {};
10911092
try {
10921093
var filler =
10931094
regexpCompileCache[path] ||
10941095
(regexpCompileCache[path] = pathToRegexp_1.compile(path));
1095-
return filler(params || {}, { pretty: true })
1096+
1097+
// Fix #2505 resolving asterisk routes { name: 'not-found', params: { pathMatch: '/not-found' }}
1098+
if (params.pathMatch) { params[0] = params.pathMatch; }
1099+
1100+
return filler(params, { pretty: true })
10961101
} catch (e) {
10971102
{
10981103
warn(false, ("missing param for " + routeMsg + ": " + (e.message)));
10991104
}
11001105
return ''
1106+
} finally {
1107+
// delete the 0 if it was added
1108+
delete params[0];
11011109
}
11021110
}
11031111

@@ -1276,8 +1284,10 @@ function normalizeLocation (
12761284
) {
12771285
var next = typeof raw === 'string' ? { path: raw } : raw;
12781286
// named target
1279-
if (next.name || next._normalized) {
1287+
if (next._normalized) {
12801288
return next
1289+
} else if (next.name) {
1290+
return extend({}, raw)
12811291
}
12821292

12831293
// relative params
@@ -2134,7 +2144,7 @@ function poll (
21342144

21352145
/* */
21362146

2137-
var HTML5History = (function (History$$1) {
2147+
var HTML5History = /*@__PURE__*/(function (History$$1) {
21382148
function HTML5History (router, base) {
21392149
var this$1 = this;
21402150

@@ -2222,7 +2232,7 @@ function getLocation (base) {
22222232

22232233
/* */
22242234

2225-
var HashHistory = (function (History$$1) {
2235+
var HashHistory = /*@__PURE__*/(function (History$$1) {
22262236
function HashHistory (router, base, fallback) {
22272237
History$$1.call(this, router, base);
22282238
// check history fallback deeplinking
@@ -2359,7 +2369,7 @@ function replaceHash (path) {
23592369

23602370
/* */
23612371

2362-
var AbstractHistory = (function (History$$1) {
2372+
var AbstractHistory = /*@__PURE__*/(function (History$$1) {
23632373
function AbstractHistory (router, base) {
23642374
History$$1.call(this, router, base);
23652375
this.stack = [];
@@ -2572,9 +2582,10 @@ VueRouter.prototype.resolve = function resolve (
25722582
current,
25732583
append
25742584
) {
2585+
current = current || this.history.current;
25752586
var location = normalizeLocation(
25762587
to,
2577-
current || this.history.current,
2588+
current,
25782589
append,
25792590
this
25802591
);
@@ -2615,7 +2626,7 @@ function createHref (base, fullPath, mode) {
26152626
}
26162627

26172628
VueRouter.install = install;
2618-
VueRouter.version = '3.0.2';
2629+
VueRouter.version = '3.0.3';
26192630

26202631
if (inBrowser && window.Vue) {
26212632
window.Vue.use(VueRouter);

0 commit comments

Comments
 (0)