在设置组件的属性时,许多代码示例使用Ext.apply方法在initComponent方法中。
例如:
initComponent: function(){
Ext.apply(this, {
items: {
xtype: 'button'
}
})},
我的问题是,这样做和那样做的区别是什么:
initComponent: function(){
this.items = {
xtype: 'button'
}
}
对我来说,那样更易读。但如果我不使用Ext.apply,是否会错过什么重要的东西?