Skip to content

Commit 23bedc9

Browse files
committed
fix instance unregistration (fix #1372)
1 parent 34b9abc commit 23bedc9

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/components/view.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,11 @@ export default {
5252
// this will be called in the instance's injected lifecycle hooks
5353
data.registerRouteInstance = (vm, val) => {
5454
// val could be undefined for unregistration
55-
if (matched.instances[name] !== vm) {
55+
const current = matched.instances[name]
56+
if (
57+
(val && current !== vm) ||
58+
(!val && current === vm)
59+
) {
5660
matched.instances[name] = val
5761
}
5862
}

0 commit comments

Comments
 (0)