vue learning in the second quarter

Custom command vue.directive

Extending vue.extend constructor (for template parameters need to pass)

vue.set global operations

Lifecycle hook function

  In beforeCreate when the hook function call, get less than props or data in the data, because the data volume is initialized in initState in.

  Then execute created hook function, in this step when you can have access to the data can not be accessed before, but this time the assembly has not been mounted, so can not see.

  The next execution beforeMount hook function, start creating VDOM, the last execution mounted hooks and rendered into VDOM really DOM and rendering data. If you have sub-assembly components, sub-assemblies mounted recursively only when all the sub-mount components are all completed, the mount will be performed with the hook component.

  Next is the hook function will be called when data updates beforeUpdate and Updated , respectively, before and after the data update data updated with

  keep-alive unique life cycle, are activated and deactivated , with keep-alive components of the package will not be destroyed when switching, but cached in memory to perform deactivated hook function is executed after the hit cache rendered actived hook function.

  Finally, the destruction of the components of the hook function brforeDestroy and Destroyed . The former is suitable to remove events, timers, etc., as this may cause memory leaks. Then a series of destruction operations, if there are sub-components, it would have destroyed the recursive sub-components, sub-components are all destroyed after the completion of the implementation of the root component destroyed hook function.

template: Template

component: Component

  

 

Guess you like

Origin www.cnblogs.com/xiaohaha668/p/10981221.html