[LayaAir 2.0]我看到这段话后,我

    /**
    *<p>数据赋值,通过对UI赋值来控制UI显示逻辑。</p>
    *<p>简单赋值会更改组件的默认属性,使用大括号可以指定组件的任意属性进行赋值。</p>
    *@example
    //默认属性赋值
    dataSource={label1:"改变了label",checkbox1:true};//(更改了label1的text属性值,更改checkbox1的selected属性)。
    //任意属性赋值
    dataSource={label2:{text:"改变了label",size:14},checkbox2:{selected:true,x:10}};
    */
    __getset(0,__proto,'dataSource',function(){
        return this._dataSource;
        },function(value){
        this._dataSource=value;
        for (var prop in this._dataSource){
            if (this.hasOwnProperty(prop)&& !((typeof (this[prop])=='function'))){
                this[prop]=this._dataSource[prop];
            }
        }
    }); 在UIComponent中
已邀请:

Aar0n

赞同来自:

请问问题是什么?
 

layabox

赞同来自:

不判断会把函数覆盖掉

要回复问题请先

商务合作
商务合作