<ks-editor ref="editDom"
:audioDetail="audioData"
:editorConfig="editorConfig"
:tag="666"
placeholder="请输入"
@focus="handlefocus"
@audioChange="audioChange"
@blur="handleBlur"
@input="handleInput"/>
this.$refs['editdom'].getHtmlContent()
this.$refs['editdom'].setHtmlContent('hello world')
入参 | 说明 | 是否必填 |
---|
audioDetail | 语音信息 | 非必填 |
editorConfig | 快捷工具栏配置 | 必填 |
tag | 同一个页面初始化多个ks-editor时区分使用 | 非必填 |
audioChange (data) {
this.audioData = data
},
audioDetail = {
bizId,
length
}
editorConfig = [
{
key: 'audio',
label: '语音',
iconUrl: 'tool-audio.png',
},
{
key: 'style',
label: '样式',
iconUrl: 'tool-style.png',
isShowHistory: true,
maxLength: 700
},
{
key: 'bold',
label: '加粗',
isRichEditorOption: true,
},
{
key: 'listOrdered',
label: '序列',
isRichEditorOption: true,
},
{
key: 'color',
label: '颜色',
isRichEditorOption: true,
colorPops: [
'#333333',
'#f92b2d',
'#ffbe00',
],
},
{
key: 'confirm',
formatter: () => {
return (
<div class="mini-toolbar-item" onClick={this.confirmExitAndSave}>
<span class="btn-label confirm-btn">保存</span>
</div>
)
}
}
]