draft.js的输出是什么样?

问题描述 投票:0回答:1

我在哪里可以找到draft.js的输出示例?我想找到向编辑器添加图像,提及内容等的输出示例。我的意思是该字符串作为输出应存储到数据库中。

javascript reactjs draftjs
1个回答
0
投票

Flow typing在这里,复制如下。

export type RawDraftContentState = {
  blocks: Array<RawDraftContentBlock>,
  entityMap: {[key: string]: RawDraftEntity, ...},
};

export type RawDraftContentBlock = {
  key: ?string,
  type: DraftBlockType,
  text: string,
  depth: ?number,
  inlineStyleRanges: ?Array<InlineStyleRange>,
  entityRanges: ?Array<EntityRange>,
  data?: Object,
  children?: Array<RawDraftContentBlock>,
  ...
};

export type RawDraftEntity = {
  type: DraftEntityType,
  mutability: DraftEntityMutability,
  data: ?{[key: string]: any, ...},
  ...
};
© www.soinside.com 2019 - 2024. All rights reserved.