【发布时间】:2018-05-17 09:08:54
【问题描述】:
我是 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 文件夹中。
独立的猎户座工作正常 - http://libingw.github.io/OrionCodeEdit/ 与 dojo 集成时,我不确定为什么 orion 未定义。 任何帮助将非常感激。
【问题讨论】:
标签: dojo eclipse-orion