Skip to content

Commit 5dcb7ea

Browse files
committed
[build] 2.3.1
1 parent fb9a0cb commit 5dcb7ea

File tree

4 files changed

+32
-18
lines changed

4 files changed

+32
-18
lines changed

dist/vue-router.common.js

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* vue-router v2.2.1
2+
* vue-router v2.3.1
33
* (c) 2017 Evan You
44
* @license MIT
55
*/
@@ -1449,7 +1449,8 @@ function getScrollPosition () {
14491449
}
14501450

14511451
function getElementPosition (el) {
1452-
var docRect = document.documentElement.getBoundingClientRect();
1452+
var docEl = document.documentElement;
1453+
var docRect = docEl.getBoundingClientRect();
14531454
var elRect = el.getBoundingClientRect();
14541455
return {
14551456
x: elRect.left - docRect.left,
@@ -1680,7 +1681,7 @@ function normalizeBase (base) {
16801681
if (inBrowser) {
16811682
// respect <base> tag
16821683
var baseEl = document.querySelector('base');
1683-
base = baseEl ? baseEl.getAttribute('href') : '/';
1684+
base = (baseEl && baseEl.getAttribute('href')) || '/';
16841685
} else {
16851686
base = '/';
16861687
}
@@ -1895,19 +1896,23 @@ var HTML5History = (function (History$$1) {
18951896
HTML5History.prototype.push = function push (location, onComplete, onAbort) {
18961897
var this$1 = this;
18971898

1899+
var ref = this;
1900+
var fromRoute = ref.current;
18981901
this.transitionTo(location, function (route) {
18991902
pushState(cleanPath(this$1.base + route.fullPath));
1900-
handleScroll(this$1.router, route, this$1.current, false);
1903+
handleScroll(this$1.router, route, fromRoute, false);
19011904
onComplete && onComplete(route);
19021905
}, onAbort);
19031906
};
19041907

19051908
HTML5History.prototype.replace = function replace (location, onComplete, onAbort) {
19061909
var this$1 = this;
19071910

1911+
var ref = this;
1912+
var fromRoute = ref.current;
19081913
this.transitionTo(location, function (route) {
19091914
replaceState(cleanPath(this$1.base + route.fullPath));
1910-
handleScroll(this$1.router, route, this$1.current, false);
1915+
handleScroll(this$1.router, route, fromRoute, false);
19111916
onComplete && onComplete(route);
19121917
}, onAbort);
19131918
};
@@ -2269,7 +2274,7 @@ function createHref (base, fullPath, mode) {
22692274
}
22702275

22712276
VueRouter.install = install;
2272-
VueRouter.version = '2.2.1';
2277+
VueRouter.version = '2.3.1';
22732278

22742279
if (inBrowser && window.Vue) {
22752280
window.Vue.use(VueRouter);

dist/vue-router.esm.js

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* vue-router v2.2.1
2+
* vue-router v2.3.1
33
* (c) 2017 Evan You
44
* @license MIT
55
*/
@@ -1894,19 +1894,23 @@ var HTML5History = (function (History$$1) {
18941894
HTML5History.prototype.push = function push (location, onComplete, onAbort) {
18951895
var this$1 = this;
18961896

1897+
var ref = this;
1898+
var fromRoute = ref.current;
18971899
this.transitionTo(location, function (route) {
18981900
pushState(cleanPath(this$1.base + route.fullPath));
1899-
handleScroll(this$1.router, route, this$1.current, false);
1901+
handleScroll(this$1.router, route, fromRoute, false);
19001902
onComplete && onComplete(route);
19011903
}, onAbort);
19021904
};
19031905

19041906
HTML5History.prototype.replace = function replace (location, onComplete, onAbort) {
19051907
var this$1 = this;
19061908

1909+
var ref = this;
1910+
var fromRoute = ref.current;
19071911
this.transitionTo(location, function (route) {
19081912
replaceState(cleanPath(this$1.base + route.fullPath));
1909-
handleScroll(this$1.router, route, this$1.current, false);
1913+
handleScroll(this$1.router, route, fromRoute, false);
19101914
onComplete && onComplete(route);
19111915
}, onAbort);
19121916
};
@@ -2268,7 +2272,7 @@ function createHref (base, fullPath, mode) {
22682272
}
22692273

22702274
VueRouter.install = install;
2271-
VueRouter.version = '2.2.1';
2275+
VueRouter.version = '2.3.1';
22722276

22732277
if (inBrowser && window.Vue) {
22742278
window.Vue.use(VueRouter);

dist/vue-router.js

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* vue-router v2.2.1
2+
* vue-router v2.3.1
33
* (c) 2017 Evan You
44
* @license MIT
55
*/
@@ -1453,7 +1453,8 @@ function getScrollPosition () {
14531453
}
14541454

14551455
function getElementPosition (el) {
1456-
var docRect = document.documentElement.getBoundingClientRect();
1456+
var docEl = document.documentElement;
1457+
var docRect = docEl.getBoundingClientRect();
14571458
var elRect = el.getBoundingClientRect();
14581459
return {
14591460
x: elRect.left - docRect.left,
@@ -1684,7 +1685,7 @@ function normalizeBase (base) {
16841685
if (inBrowser) {
16851686
// respect <base> tag
16861687
var baseEl = document.querySelector('base');
1687-
base = baseEl ? baseEl.getAttribute('href') : '/';
1688+
base = (baseEl && baseEl.getAttribute('href')) || '/';
16881689
} else {
16891690
base = '/';
16901691
}
@@ -1899,19 +1900,23 @@ var HTML5History = (function (History$$1) {
18991900
HTML5History.prototype.push = function push (location, onComplete, onAbort) {
19001901
var this$1 = this;
19011902

1903+
var ref = this;
1904+
var fromRoute = ref.current;
19021905
this.transitionTo(location, function (route) {
19031906
pushState(cleanPath(this$1.base + route.fullPath));
1904-
handleScroll(this$1.router, route, this$1.current, false);
1907+
handleScroll(this$1.router, route, fromRoute, false);
19051908
onComplete && onComplete(route);
19061909
}, onAbort);
19071910
};
19081911

19091912
HTML5History.prototype.replace = function replace (location, onComplete, onAbort) {
19101913
var this$1 = this;
19111914

1915+
var ref = this;
1916+
var fromRoute = ref.current;
19121917
this.transitionTo(location, function (route) {
19131918
replaceState(cleanPath(this$1.base + route.fullPath));
1914-
handleScroll(this$1.router, route, this$1.current, false);
1919+
handleScroll(this$1.router, route, fromRoute, false);
19151920
onComplete && onComplete(route);
19161921
}, onAbort);
19171922
};
@@ -2273,7 +2278,7 @@ function createHref (base, fullPath, mode) {
22732278
}
22742279

22752280
VueRouter.install = install;
2276-
VueRouter.version = '2.2.1';
2281+
VueRouter.version = '2.3.1';
22772282

22782283
if (inBrowser && window.Vue) {
22792284
window.Vue.use(VueRouter);

0 commit comments

Comments
 (0)