how can component delete itself in Vue 2.0

后端 未结 4 1026
有刺的猬
有刺的猬 2021-01-03 18:47

as title, how can I do that

from offical documentation just tell us that $delete can use argument \'object\' and \'key\'

but I want delete a component by its

4条回答
  •  陌清茗
    陌清茗 (楼主)
    2021-01-03 19:30

    Instead of deleting your component from its parent you can still use v-if on the first

    tag from the component itself. This would leave an empty component in your page and it's not best practice but may avoid handling events from parent.

提交回复
热议问题