我正在使用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();
我有一些要从数据库中获取的值,并希望显示在附随者上。我是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 here。
关于javascript - 在EpicEditor上设置动态值,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/18146821/