Skip to content

Commit 725453c

Browse files
committed
chore(release): 3.0.5
1 parent c3abdf6 commit 725453c

7 files changed

+93
-37
lines changed

Diff for: dist/vue-router.common.js

+22-8
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*!
2-
* vue-router v3.0.4
2+
* vue-router v3.0.5
33
* (c) 2019 Evan You
44
* @license MIT
55
*/
@@ -60,11 +60,14 @@ var View = {
6060
var depth = 0;
6161
var inactive = false;
6262
while (parent && parent._routerRoot !== parent) {
63-
if (parent.$vnode && parent.$vnode.data.routerView) {
64-
depth++;
65-
}
66-
if (parent._inactive) {
67-
inactive = true;
63+
var vnodeData = parent.$vnode && parent.$vnode.data;
64+
if (vnodeData) {
65+
if (vnodeData.routerView) {
66+
depth++;
67+
}
68+
if (vnodeData.keepAlive && parent._inactive) {
69+
inactive = true;
70+
}
6871
}
6972
parent = parent.$parent;
7073
}
@@ -103,6 +106,17 @@ var View = {
103106
matched.instances[name] = vnode.componentInstance;
104107
};
105108

109+
// register instance in init hook
110+
// in case kept-alive component be actived when routes changed
111+
data.hook.init = function (vnode) {
112+
if (vnode.data.keepAlive &&
113+
vnode.componentInstance &&
114+
vnode.componentInstance !== matched.instances[name]
115+
) {
116+
matched.instances[name] = vnode.componentInstance;
117+
}
118+
};
119+
106120
// resolve props
107121
var propsToPass = data.props = resolveProps(route, matched.props && matched.props[name]);
108122
if (propsToPass) {
@@ -1758,7 +1772,7 @@ function resolveAsyncComponents (matched) {
17581772
match.components[key] = resolvedDef;
17591773
pending--;
17601774
if (pending <= 0) {
1761-
next();
1775+
next(to);
17621776
}
17631777
});
17641778

@@ -2650,7 +2664,7 @@ function createHref (base, fullPath, mode) {
26502664
}
26512665

26522666
VueRouter.install = install;
2653-
VueRouter.version = '3.0.4';
2667+
VueRouter.version = '3.0.5';
26542668

26552669
if (inBrowser && window.Vue) {
26562670
window.Vue.use(VueRouter);

Diff for: dist/vue-router.esm.browser.js

+22-8
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*!
2-
* vue-router v3.0.4
2+
* vue-router v3.0.5
33
* (c) 2019 Evan You
44
* @license MIT
55
*/
@@ -53,11 +53,14 @@ var View = {
5353
let depth = 0;
5454
let inactive = false;
5555
while (parent && parent._routerRoot !== parent) {
56-
if (parent.$vnode && parent.$vnode.data.routerView) {
57-
depth++;
58-
}
59-
if (parent._inactive) {
60-
inactive = true;
56+
const vnodeData = parent.$vnode && parent.$vnode.data;
57+
if (vnodeData) {
58+
if (vnodeData.routerView) {
59+
depth++;
60+
}
61+
if (vnodeData.keepAlive && parent._inactive) {
62+
inactive = true;
63+
}
6164
}
6265
parent = parent.$parent;
6366
}
@@ -96,6 +99,17 @@ var View = {
9699
matched.instances[name] = vnode.componentInstance;
97100
};
98101

102+
// register instance in init hook
103+
// in case kept-alive component be actived when routes changed
104+
data.hook.init = (vnode) => {
105+
if (vnode.data.keepAlive &&
106+
vnode.componentInstance &&
107+
vnode.componentInstance !== matched.instances[name]
108+
) {
109+
matched.instances[name] = vnode.componentInstance;
110+
}
111+
};
112+
99113
// resolve props
100114
let propsToPass = data.props = resolveProps(route, matched.props && matched.props[name]);
101115
if (propsToPass) {
@@ -1730,7 +1744,7 @@ function resolveAsyncComponents (matched) {
17301744
match.components[key] = resolvedDef;
17311745
pending--;
17321746
if (pending <= 0) {
1733-
next();
1747+
next(to);
17341748
}
17351749
});
17361750

@@ -2608,7 +2622,7 @@ function createHref (base, fullPath, mode) {
26082622
}
26092623

26102624
VueRouter.install = install;
2611-
VueRouter.version = '3.0.4';
2625+
VueRouter.version = '3.0.5';
26122626

26132627
if (inBrowser && window.Vue) {
26142628
window.Vue.use(VueRouter);

Diff for: dist/vue-router.esm.browser.min.js

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Diff for: dist/vue-router.esm.js

+22-8
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*!
2-
* vue-router v3.0.4
2+
* vue-router v3.0.5
33
* (c) 2019 Evan You
44
* @license MIT
55
*/
@@ -58,11 +58,14 @@ var View = {
5858
var depth = 0;
5959
var inactive = false;
6060
while (parent && parent._routerRoot !== parent) {
61-
if (parent.$vnode && parent.$vnode.data.routerView) {
62-
depth++;
63-
}
64-
if (parent._inactive) {
65-
inactive = true;
61+
var vnodeData = parent.$vnode && parent.$vnode.data;
62+
if (vnodeData) {
63+
if (vnodeData.routerView) {
64+
depth++;
65+
}
66+
if (vnodeData.keepAlive && parent._inactive) {
67+
inactive = true;
68+
}
6669
}
6770
parent = parent.$parent;
6871
}
@@ -101,6 +104,17 @@ var View = {
101104
matched.instances[name] = vnode.componentInstance;
102105
};
103106

107+
// register instance in init hook
108+
// in case kept-alive component be actived when routes changed
109+
data.hook.init = function (vnode) {
110+
if (vnode.data.keepAlive &&
111+
vnode.componentInstance &&
112+
vnode.componentInstance !== matched.instances[name]
113+
) {
114+
matched.instances[name] = vnode.componentInstance;
115+
}
116+
};
117+
104118
// resolve props
105119
var propsToPass = data.props = resolveProps(route, matched.props && matched.props[name]);
106120
if (propsToPass) {
@@ -1756,7 +1770,7 @@ function resolveAsyncComponents (matched) {
17561770
match.components[key] = resolvedDef;
17571771
pending--;
17581772
if (pending <= 0) {
1759-
next();
1773+
next(to);
17601774
}
17611775
});
17621776

@@ -2648,7 +2662,7 @@ function createHref (base, fullPath, mode) {
26482662
}
26492663

26502664
VueRouter.install = install;
2651-
VueRouter.version = '3.0.4';
2665+
VueRouter.version = '3.0.5';
26522666

26532667
if (inBrowser && window.Vue) {
26542668
window.Vue.use(VueRouter);

Diff for: dist/vue-router.js

+22-8
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*!
2-
* vue-router v3.0.4
2+
* vue-router v3.0.5
33
* (c) 2019 Evan You
44
* @license MIT
55
*/
@@ -64,11 +64,14 @@ var View = {
6464
var depth = 0;
6565
var inactive = false;
6666
while (parent && parent._routerRoot !== parent) {
67-
if (parent.$vnode && parent.$vnode.data.routerView) {
68-
depth++;
69-
}
70-
if (parent._inactive) {
71-
inactive = true;
67+
var vnodeData = parent.$vnode && parent.$vnode.data;
68+
if (vnodeData) {
69+
if (vnodeData.routerView) {
70+
depth++;
71+
}
72+
if (vnodeData.keepAlive && parent._inactive) {
73+
inactive = true;
74+
}
7275
}
7376
parent = parent.$parent;
7477
}
@@ -107,6 +110,17 @@ var View = {
107110
matched.instances[name] = vnode.componentInstance;
108111
};
109112

113+
// register instance in init hook
114+
// in case kept-alive component be actived when routes changed
115+
data.hook.init = function (vnode) {
116+
if (vnode.data.keepAlive &&
117+
vnode.componentInstance &&
118+
vnode.componentInstance !== matched.instances[name]
119+
) {
120+
matched.instances[name] = vnode.componentInstance;
121+
}
122+
};
123+
110124
// resolve props
111125
var propsToPass = data.props = resolveProps(route, matched.props && matched.props[name]);
112126
if (propsToPass) {
@@ -1762,7 +1776,7 @@ function resolveAsyncComponents (matched) {
17621776
match.components[key] = resolvedDef;
17631777
pending--;
17641778
if (pending <= 0) {
1765-
next();
1779+
next(to);
17661780
}
17671781
});
17681782

@@ -2654,7 +2668,7 @@ function createHref (base, fullPath, mode) {
26542668
}
26552669

26562670
VueRouter.install = install;
2657-
VueRouter.version = '3.0.4';
2671+
VueRouter.version = '3.0.5';
26582672

26592673
if (inBrowser && window.Vue) {
26602674
window.Vue.use(VueRouter);

Diff for: dist/vue-router.min.js

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Diff for: package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "vue-router",
3-
"version": "3.0.4",
3+
"version": "3.0.5",
44
"description": "Official router for Vue.js 2",
55
"author": "Evan You",
66
"license": "MIT",

0 commit comments

Comments
 (0)