python - 无法使用 ace-builds 设置 themePath

标签 python ace-editor

我能够在 ace-editor 中获取 themePath(我正在使用 nom ace-builds 包)来工作。我可以设置基本路径,并且编辑器可以正常加载,但它仍在默认目录中查找主题。

import ace
import ace from 'ace-builds'
import {Range, EditSession} from 'ace-builds'

// import modes that you want to include into your main bundle
import "ace-builds/src-noconflict/mode-yaml";

// import webpack resolver to dynamically load modes,
   you need to install file-loader for this to work!
   import "ace-builds/webpack-resolver";

ace.config.set("themePath","../static/js");
ace.config.set("basePath","../static/js");
ace.config.set("modePath","../static/js");

var editor = ace.edit("ace_editor_playbook", {
        maxLines: 25,
        minLines: 25,
        value: "---" + "\n",
        mode: "ace/mode/yaml",
        theme: "ace/theme/vibrant_ink",
        bug: 1
      })

谢谢。

最佳答案

未使用 themePath,因为 https://github.com/ajaxorg/ace-builds/blob/master/webpack-resolver.js明确设置所有主题的路径。如果你想使用 themePath 不要加载 webpack-resolver

关于python - 无法使用 ace-builds 设置 themePath,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54799156/

相关文章:

python - 扩展python abc类的类的自动委托(delegate)

ace-editor - 在Ace Editor中是否有键盘启动保存的事件?

jquery - 在 Ace Editor 中键入空格会产生特殊字符

Ace 文本编辑器的 TypeScript 声明

javascript - 光标在 Ace 中如何工作

python - Python 和 Matlab 中的克罗内克积

python - 使用python比较多个字典的键和值

python - Django if 语句未按预期工作

python - 从Python中的排序列表中获取某些数据

javascript - ace.js 中的标记和动态标记有什么区别