Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/wordpress/13.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Sencha touch 有没有更好的方法来违约?_Sencha Touch_Prototyping - Fatal编程技术网

Sencha touch 有没有更好的方法来违约?

Sencha touch 有没有更好的方法来违约?,sencha-touch,prototyping,Sencha Touch,Prototyping,我在touch中创建了原型,但是Ext.create告诉我去检查Ext.define,所以我又开始做了 ViewPort= function(c){ var default={ fullscreen:true, items:[] };Ext.apply(default,c);config = default; ViewPort.superclass.constructor.call(this,config); }; Ext.extend(

我在touch中创建了原型,但是Ext.create告诉我去检查Ext.define,所以我又开始做了

ViewPort= function(c){
    var default={
        fullscreen:true,
        items:[]
    };Ext.apply(default,c);config = default;

    ViewPort.superclass.constructor.call(this,config);
};
Ext.extend( ViewPort, Ext.Panel);
然后用函数和其他东西操纵配置。
有没有更好的方法来完成默认变量为我所做的事情?

这更短,更整洁

ViewPort= function(config){
    config=Ext.apply({},config,{
        fullscreen:true
        items:[],
    });

    ViewPort.superclass.constructor.call(this,config);
};
Ext.extend( ViewPort, Ext.Panel);