EditorContext

EditorContext 实例,可通过 mc.createSelectorQuery 获取。

EditorContext 通过 ideditor 组件绑定,操作对应的 editor 组件。

方法

覆盖当前选区,设置一段文本

EditorContext.setContents(Object object)

初始化编辑器内容,html和delta同时存在时仅delta生效

Object object 参数
属性 类型 默认值 必填 说明
html String 带标签的HTML内容
delta Object 表示内容的 delta 对象
success Function 接口调用成功的回调函数
fail Function 接口调用失败的回调函数
complete Function 接口调用结束的回调函数(调用成功、失败都会执行)

EditorContext.getContents(Object object)

获取编辑器内容

Object object 参数
属性 类型 默认值 必填 说明
success Function 接口调用成功的回调函数
fail Function 接口调用失败的回调函数
complete Function 接口调用结束的回调函数(调用成功、失败都会执行)

Object.success(Object res) | 属性 | 类型 | 说明 | | :--------------- | :------ | :----------------------- | | html | String | 带标签的HTML内容 | | text | String | 纯文本内容 | | delta | Object | 表示内容的 delta 对象 |

EditorContext.clear()

清空编辑器内容

results matching ""

    No results matching ""

    results matching ""

      No results matching ""