Skip to content

Commit 0cf8018

Browse files
committed
ensure instance is set when different routes use the same component (fix #779)
1 parent 83c587f commit 0cf8018

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/components/view.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,9 @@ export default {
4141
hooks.init = vnode => {
4242
matched.instances[name] = vnode.child
4343
}
44+
hooks.prepatch = (oldVnode, vnode) => {
45+
matched.instances[name] = vnode.child
46+
}
4447
hooks.destroy = vnode => {
4548
if (matched.instances[name] === vnode.child) {
4649
matched.instances[name] = undefined

0 commit comments

Comments
 (0)