We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 4201c9d commit df39bd6Copy full SHA for df39bd6
src/components/view.js
@@ -31,13 +31,20 @@ export default {
31
return h()
32
}
33
34
+ const name = props.name
35
const component = inactive
- ? cache[props.name]
36
- : (cache[props.name] = matched.components[props.name])
+ ? cache[name]
37
+ : (cache[name] = matched.components[name])
38
39
if (!inactive) {
- (data.hook || (data.hook = {})).init = vnode => {
40
- matched.instances[props.name] = vnode.child
+ const hooks = data.hook || (data.hook = {})
41
+ hooks.init = vnode => {
42
+ matched.instances[name] = vnode.child
43
+ }
44
+ hooks.destroy = vnode => {
45
+ if (matched.instances[name] === vnode.child) {
46
+ matched.instances[name] = undefined
47
48
49
50
0 commit comments