vue in nextTick

() Hook function DOM operations created vue life cycle must be placed vue.nextTick () callback function.

Because created () function executes when a hook, in fact, did not make any DOM rendering, so it is useless to perform DOM operations, and many more must be placed vue.nextTick () callback function.

Mounted corresponding thereto is () hook function, because the hooking function executes all loading and rendering of the DOM have been completed.

In an action to be performed after the data changes, the operation requires the use of time if the data changes alter the DOM structure, this operation should be put vue.nextTick (callback).

 

Guess you like

Origin www.cnblogs.com/150536FBB/p/11344825.html