Explain this confusing dojo tutorial syntax for declare

梦想的初衷 提交于 2019-12-05 11:42:27

Well, consider it an overloaded constructor:

// class with a name
declare(className: String, superClass: Array, classDeclaration: Object);

// class without a name
declare(superClass: Array, classDeclaration: Object);

Use an empty array [] or null for no superClass.

N.B.: As of Dojo 1.8, there is no need for named classes, because dojo/parser can use a module id (mid, e.g. "mynamespace/MyClass") for instantiation. I consider named classes to be obsolete and against code maintainability.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!