前端框架Aurelia——组件Component(二)组件生命周期

  1. constructor() - The view-model's constructor is called first.
  2. created(owningView: View, myView: View)
The created callback will receive the instance of the "owningView".
This is the view that the component is declared inside of.
If the component itself has a view, this will be passed second.
owningView是这个组件要在哪个View里面渲染,myView是自己的view。如果有自己的view,这个owningView
就会被变成第二顺位。

3.bind(bindingContext: Object, overrideContext: Object)
If the view-model has a bind callback, it will be invoked at this time. 
The "binding context" to which the component is being bound will be passed first.
An "override context" will be passed second. 

4. attached() - Next, the component is attached to the DOM (in document).
If the view-model has an attached callback, it will be invoked at this time
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值