[Summer Vacation] Vue Life Cycle - Notes

What is a life cycle?

life cycle:

                Also known as: lifecycle callback function, lifecycle function, lifecycle hook.

                 The so-called lifecycle functions are functions with special names that Vue calls for us at critical moments

                The name of the life cycle function cannot be changed, but the specific content of the function is written by the programmer according to the requirements

                The this in the life cycle function points to the vm or component instance object

1.

 In the case of duplicate attributes and data names, it can be written in abbreviated form ⬇⬇⬇⬇⬇

2. What is onload?

The onload event (load event) occurs immediately after the page or image has loaded

The onload event is usually used on the <body> element, after the page is fully loaded (including images, CSS files, etc.). Then execute the script code

example:

                window.οnlοad= function()   

3. What is mount?

Putting in the step of putting the real DOM into the page , the official technical term is called mount

        Further understanding:

                After Vue finishes parsing the template and puts the initial (that is, the first parsed) real DOM element into the page (completes the mounting), it calls the mounted function

expand:

        Init: full name: initialization translation: initialization

        Component Translation:  When used as a noun, it means "component; ingredient; component, element", when used as an adjective, it means "composed of; constituted

        node : translation: node

        render means rendering

        re-render means to re-render

        Teardown: means to remove

The option here is the meaning of the configuration item data, the configuration item should be....

4. When debugging, you can use debugger to set breakpoints

5. At which lifecycle hook is the page and data not yet in sync?

beforeUpdate At this point: the data is new, but the page is old, that is: the page has not been synchronized with the data

6. The translation of the patch itself means patching, but here it should be a comparison between the new virtual DOM and the old virtual DOM

7. Summary:

Guess you like

Origin blog.csdn.net/IDApprentice/article/details/126412962