Stage 5 3. Micro Services [online] studies _day02 CMS front-end development _24-CMS front page query development - using the hook method to achieve immediate inquiry


Enter the default page to go query data
this hook function to use vue, Vue each instance must go through a series of initialization processes when they are created - for example, need to set the monitor data,
compiled templates, examples will be mounted to the DOM and update the DOM, and when the data changes. But also run some called the life cycle of the hook in the process
function, which gives the user the opportunity to add your own code at different stages.

Lifecycle Figure Reference:
http://baijiahao.baidu.com/s?id=1603406094025961442&wfr=spider&for=pc

commonly used most is created and mounted two hooks:
created: VUE instance has been created but not yet rendered DOM element generation.
mounted: DOM element rendering generated after the completion of calls.

Hook function in the methods defined below

the page loads immediately called.


 

Guess you like

Origin www.cnblogs.com/wangjunwei/p/11564007.html