new LinwitDocEditor({
element: "#aiEditor",
placeholder: "点击输入内容...",
theme: "light",
content: 'LinwitDocEditor 是一个面向 AI 的开源富文本编辑器。 ',
contentIsMarkdown: false,
contentRetention: true,
contentRetentionKey: 'ai-editor-content',
draggable: true,
pasteAsText: false,
textCounter: (text: string) => number,
ai: {
models: {
spark: {
appId: "***",
apiKey: "***",
apiSecret: "***",
}
}
}
})
#editor 或者 .editor 等,也可以是一个 dom 节点对象。true。false。localStorage 的 key 值,默认为:ai-editor-content。true 时,粘贴网页内容自动清除颜色、链接、字体、字号、加粗、删除线等样式。注意:从 v1.2.0 开始,如果初始化的内容是
markdown内容,需要同时添加contentIsMarkdown:true配置。