1. new Vue({
    2. created() {
    3. console.log('实例出现在内存中')
    4. },
    5. mounted() {
    6. console.log('实例出现在网页中')
    7. },
    8. updated() {
    9. console.log('实例更新了')
    10. },
    11. destroyed() {
    12. console.log('实例消亡了')
    13. }
    14. })
    • beforeCreate
    • created:实例出现在内存中
    • beforeMount
    • mounted(mount:挂载):实例出现在网页中
    • beforeUpdate
    • updated:实例更新了
    • activated
    • deactivated
    • beforeDestroy
    • destroyed:实例消亡了
    • errorCaptured

    lifecycle.jpg