flex 组建重写

flex历经几个版本的变化,其封装性也越来越规范。

今日flex的学习,总结是组件的重写。

项目中为使组件的针对性,易用性更强 ,免不了要重写组件。

要改变你的对手你的了解你的对手。

一个组件从被new到渲染出来主要经历几个重要事件,其顺序为:

1.Constructor  2.creatChildren  3.commitProperties  4.measure  5.updateDisplayList

分别对其解读:

constructor是构造函数,其作用不言而喻。

creatChildren是向重写的组件中添加子组件。

constructor和creatChildren只执行一次。constructor在事件preinitialize时被调用,creatChildren在initialize时被调用。

原文地址:https://www.cnblogs.com/tiandi/p/3440680.html