【问题标题】:How can I default objects?我怎样才能默认对象?
【发布时间】:2011-06-23 01:32:15
【问题描述】:

我想做相当于...

//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})];

【问题讨论】:

    标签: javascript function extjs shorthand


    【解决方案1】:

    你能做到吗?

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

    或者您以后需要再次引用 arguments 对象吗?

    【讨论】:

    • 只是折腾默认参数,这正是我所需要的,谢谢。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2016-08-28
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多