Simple records about the life cycle and the order of execution vue parent component and subassembly lifecycle hook

First, vue life cycle can be simply understood by the following chart

Of course, this is the picture of official documents, detailed vue period Detailed please refer here

However, when there is a parent-child components while the life cycle of the hook is how to implement it?

See below:

    1. Load rendering process
      父beforeCreate->父created->父beforeMount->子beforeCreate->子created->子beforeMount->子mounted->父mounted
    2. Subassemblies update process
      父beforeUpdate->子beforeUpdate->子updated->父updated
    3. Parent component update process
      父beforeUpdate->父updated
    4. The destruction process
      父beforeDestroy->子beforeDestroy->子destroyed->父destroyed

the above.

Guess you like

Origin www.cnblogs.com/wangtong111/p/11204525.html