跳到主要内容

api.getState()

描述

返回包含 RichText 的 StateStore 属性的对象

用法

api.getState(): object;

返回值

该方法返回一个包含以下参数的对象:

{     
cursorState: {},
defaultStyles: {},
document: {},
fullscreen: boolean,
history: []
layoutMode: string,
popup: any,
selection: {}
}

示例

// 初始化 RichText
const editor = new richtext.Richtext("#root", {
// 配置属性
});
// 获取 RichText 的状态
const state = editor.api.getState();
console.log(state);

更新日志: 该方法在 v2.0 中添加