在EpicEditor上设置动态值

Set dynamic value on EpicEditor

本文关键字:动态 设置 EpicEditor      更新时间:2023-09-26

我使用的是EpicEditor。下面是我通过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();

我有一些值,我正在从数据库中获取,并希望在epedior上显示。我是epicEditor的新手,不知道如何做到这一点。有人能帮我吗!任何EpicEditor专家!!!

尝试将"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。