Skip to content

Commit

Permalink
fix instance unregistration (fix #1372)
Browse files Browse the repository at this point in the history
  • Loading branch information
yyx990803 committed May 1, 2017
1 parent 34b9abc commit 23bedc9
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/components/view.js
Expand Up @@ -52,7 +52,11 @@ export default {
// this will be called in the instance's injected lifecycle hooks
data.registerRouteInstance = (vm, val) => {
// val could be undefined for unregistration
if (matched.instances[name] !== vm) {
const current = matched.instances[name]
if (
(val && current !== vm) ||
(!val && current === vm)
) {
matched.instances[name] = val
}
}
Expand Down

0 comments on commit 23bedc9

Please sign in to comment.