본문으로 건너뛰기

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의 State 가져오기
const state = editor.api.getState();
console.log(state);

변경 이력: 이 메서드는 v2.0에서 추가되었습니다