可用的命令setHTML将替换现有内容。有没有办法在特定位置插入超文本标记语言内容作为insertText。
发布于 2020-06-23 19:20:48
经过长时间的研究,我发现目前还没有内置的方法来完成这项工作。但是,在Telerik论坛上提供了一种解决方法。
论坛链接:insert-html-content-to-editor
public insertHTML(editor: EditorComponent) {
editor.exec('insertText', { text: '#CURSOR#' });
// Replace cursor placeholder with new HTML and set the new editor value.
editor.value = editor.value.replace(/#CURSOR#/, this.strResult);
}https://stackoverflow.com/questions/62510915
复制相似问题