1显蝌、在初次渲染時會調(diào)用組件的
依次調(diào)用:created预伺、beforeMount、mounted曼尊、activated
2酬诀、被隱藏時調(diào)用
依次調(diào)用:deactivated
這里要注意的是,被v-if隱藏的組件骆撇,也不會被銷毀瞒御。也就是說v-if="false"時也不會調(diào)用beforeDestroy、destroyed神郊,但是會調(diào)用deactivated
3葵腹、被銷毀時調(diào)用
使用this.$destroy()銷毀時依次調(diào)用:beforeDestroy、destroyed
使用keep-alive的include屿岂、exclude銷毀時依次調(diào)用:deactivated、beforeDestroy鲸匿、destroyed