1

我正在使用EpicEditor。下面是我通过史诗编辑器初始化的代码:

 var opts = {
    container: 'epiceditor',
    textarea: null,
    theme: {
        base: '/themes/base/epiceditor.css',
        preview: '/themes/preview/github.css',
        editor: '/themes/editor/epic-light.css'
    },
    basePath: '/epiceditor',
    clientSideStorage: false
}
var editor = new EpicEditor(opts);
editor.load();

我有一些从数据库中获取的价值,并想在史诗中展示。我是史诗编辑器的新手,不知道该怎么做。有人可以帮我解决这个问题!任何 EpicEditor 专家!!!

4

1 回答 1

2

尝试将“textarea”属性设置为要将内容同步到 EpicEditor 的 textarea 字段 ID。

我的配置是这样的:

var opts = {
    container: 'epiceditor',
    textarea: null,
    basePath: 'epiceditor',
    clientSideStorage: true,
    localStorageName: 'epiceditor',
    useNativeFullscreen: true,
    parser: marked,
    file: {
        name: 'epiceditor',
        defaultContent: '',
        autoSave: 100
    },
    theme: {
        base: '/themes/base/epiceditor.css',
        preview: '/themes/preview/preview-dark.css',
        editor: '/themes/editor/epic-dark.css'
    },
    button: {
        preview: true,
        fullscreen: true
    },
    focusOnLoad: false,
    shortcut: {
        modifier: 18,
        fullscreen: 70,
        preview: 80
    },
    string: {
        togglePreview: 'Toggle Preview Mode',
        toggleEdit: 'Toggle Edit Mode',
        toggleFullscreen: 'Enter Fullscreen'
    }
}
var editor = new EpicEditor(opts);

您可以在此处查看更多 API 。

于 2013-08-12T11:31:05.157 回答