我是 dojo 的新手,我正在尝试在 dojo 中集成 orion 编辑器(从http://download.eclipse.org/orion/下载的构建),但我收到错误“orion”未定义。代码如下所示:
用于放置编辑器的 HTML 文件
<div data-dojo-attach-point="embeddedEditor"></div>
一个JS文件
require([ "dojo/_base/declare", "dijit/_WidgetBase", "editorBuild/code_edit/built-codeEdit-amd", "dijit/_TemplatedMixin", "dojo/text!orionEditor.html" ], function(declare,_WidgetBase, codeEditorAmd, _TemplatedMixin,template){ declare("orionEditor", [_WidgetBase, _TemplatedMixin], { templateString: template, postCreate: function(){ var codeEdit = new orion.codeEdit(); var contents = ''; codeEdit.create({parent: this.embeddedEditor, contentType: "application/javascript", contents: contents}). then(function(editorViewer) { if (editorViewer.settings) { editorViewer.settings.contentAssistAutoTrigger = true; editorViewer.settings.showOccurrences = true; } }); } }); });
orion 编辑器构建放置在 editorBuild 文件夹中。
独立的 orion 工作正常 - http://libingw.github.io/OrionCodeEdit/ 当与 dojo 集成时,我不确定为什么 orion 未定义。任何帮助将非常感激。