作为一个极端的例子:
require(["dojo/_base/lang", "dojo/dnd/Manager", "js/desktop/desktopAvatar", "dijit/Menu", "dijit/MenuItem", "dojo/has", "dijit/layout/TabController", "js/desktop/desktopCommons", "dijit/layout/StackController", "dojo/dom-construct", "dojo/on", "dojo/query", "dojo/dom-attr", "dojo/dom-class", "dojo/dnd/common", "dojo/request/xhr", "dojo/json", "dojo/dom-form", "js/desktop/desktopSource", "dijit/popup", "js/desktop/desktopBorderContainer", "dojo/ready", "dojo/dom", "dijit/registry", "dojo/parser", "dijit/layout/TabContainer", "dijit/Dialog", "dijit/TooltipDialog", "dojox/layout/ContentPane"], function(lang, Manager, desktopAvatar, Menu, MenuItem, has, TabController, desktopCommons, StackController, domConstruct, on, query, domAttr, domClass, dndCommons, xhr, JSON, domForm, desktopSource, popup, DesktopBorderContainer, ready, dom, registry, parser) {
Eclipse中的默认Javascript编辑器应用此格式:
require(
[ "dojo/_base/lang", "dojo/dnd/Manager", "js/desktop/desktopAvatar",
"dijit/Menu", "dijit/MenuItem", "dojo/has",
"dijit/layout/TabController", "js/desktop/desktopCommons",
"dijit/layout/StackController", "dojo/dom-construct",
"dojo/on", "dojo/query", "dojo/dom-attr", "dojo/dom-class",
"dojo/dnd/common", "dojo/request/xhr", "dojo/json",
"dojo/dom-form", "js/desktop/desktopSource", "dijit/popup",
"js/desktop/desktopBorderContainer", "dojo/ready", "dojo/dom",
"dijit/registry", "dojo/parser", "dijit/layout/TabContainer",
"dijit/Dialog", "dijit/TooltipDialog",
"dojox/layout/ContentPane" ],
function(lang, Manager, desktopAvatar, Menu, MenuItem, has,
TabController, desktopCommons, StackController, domConstruct,
on, query, domAttr, domClass, dndCommons, xhr, JSON, domForm,
desktopSource, popup, DesktopBorderContainer, ready, dom,
registry, parser) {
对于所有其他格式化,Aptana效果更好,但是很长的第一行会使添加新的必需项目变得更加困难等。
有没有办法使用Aptana Javascript格式,但长数组和函数输入是否在线上分割?
答案 0 :(得分:0)
我们也在使用Aptana&只需自己设定要求,并在每次进入后休息一下。
然后它看起来像这样:
require([
"dojo/_base/array",
"dojo/_base/Color",
"dojo/_base/window",
"dojo/dom",
"dojo/dom-construct",
"dojo/dom-style",
"dojo/json",
"dojo/on",
"dijit/registry",
"dojox/layout/FloatingPane"],
function(
array,
color,
win,
dom,
domConstruct,
domStyle,
JSON,
on,
registry,
FloatingPane){
这是使其更清晰的最简单方法。