2017-07-19 68 views
0

我无法找到一种方法来更改内置于AllouUI Widget中的Ace-Editor。下面的例子是我想用主题属性实现的。AlloyUI Ace-Editor主题变更

YUI().use( 'aui-ace-autocomplete-base', function(Y) { var editor = new Y.AceEditor( { boundingBox: '#myEditor', height: '200', mode: 'python', value: 'print("Hello there!!!")', width: '700', theme: 'chaos' } ).render(); 不幸的是,在代码中没有预定义的方式,我看到改变主题。

有没有办法将主题更改为alloyui的widget的ace编辑器?

回答

0

不知道Y.AceEditor组件公开所需的API,但你可以尝试得到真正的王牌编辑器对象,它允许更改主题动态

document.getElementById('#myEditor').env.editor.setTheme("ace/theme/chtome")