2.2.4
http://jsbin.com/canofepuyi/edit?html,console
two compoennts: comB and comA, comA as a slot into comB, when use $destroy() in comB to destroy comA, the instance is removed, but dom not.
* in Vue1, it worked. *
dom removed too
dom not removed
May be I have the same problem !
I use slot too锛寁ue2.2.4
sometimes ,$destroy works well ,but sometimes not , and destroy hooks not triggered too
In Vue 2 you should avoid directly manipulating slot children. Instead of $destroying
it, you should have a v-if
controlling the slot component in the parent:
<comp-b @close-a="showA = false">
<comp-a v-if="showA"/>
</comp-b>
Most helpful comment
In Vue 2 you should avoid directly manipulating slot children. Instead of
$destroying
it, you should have av-if
controlling the slot component in the parent: