我该如何默认对象?

时间:2011-06-22 17:04:31

标签: javascript function extjs shorthand

我想做相当于......

//Nonsensical
config.items=[Ext.create('Foo.register.AccountTypeForm',{config:arguments.hidden=true})];

//works ofc, but it looks untidy
arguments.hidden=true;
config.items=[Ext.create('Foo.register.AccountTypeForm',{config:arguments})];

1 个答案:

答案 0 :(得分:2)

你能这样做吗?

config.items=[Ext.create('Foo.register.AccountTypeForm',
 {config:{hidden:true}})];

或者您是否需要稍后再次引用arguments对象?