Skip to Content
ClassesFTheadCommentBuilder

类: FTheadCommentBuilder

A builder for thread comment. use FUniver univerAPI.newTheadComment() to create a new builder.

继承

  • FTheadCommentItem

方法

build()

build(): IThreadComment

Build the comment

返回

IThreadComment

The comment

示例

const comment = univerAPI.newTheadComment() .setContent(univerAPI.newRichText().insertText('hello zhangsan')) .build();

setContent()

setContent(content): FTheadCommentBuilder

Set the content of the comment

参数

参数类型描述
contentanyThe content of the comment

返回

FTheadCommentBuilder

The comment builder

示例

const comment = univerAPI.newTheadComment() .setContent(univerAPI.newRichText().insertText('hello zhangsan'));

setDateTime()

setDateTime(date): FTheadCommentBuilder

Set the date time of the comment

参数

参数类型描述
dateDateThe date time of the comment

返回

FTheadCommentBuilder

The comment builder

示例

const comment = univerAPI.newTheadComment() .setDateTime(new Date());

setId()

setId(id): FTheadCommentBuilder

Set the id of the comment

参数

参数类型描述
idstringThe id of the comment

返回

FTheadCommentBuilder

The comment builder

示例

const comment = univerAPI.newTheadComment() .setId('123');

setPersonId()

setPersonId(userId): FTheadCommentBuilder

Set the person id of the comment

参数

参数类型描述
userIdstringThe person id of the comment

返回

FTheadCommentBuilder

The comment builder

示例

const comment = univerAPI.newTheadComment() .setPersonId('123');

setThreadId()

setThreadId(threadId): FTheadCommentBuilder

Set the thread id of the comment

参数

参数类型描述
threadIdstringThe thread id of the comment

返回

FTheadCommentBuilder

The comment builder

示例

const comment = univerAPI.newTheadComment() .setThreadId('123');

create()

static create(comment?): FTheadCommentBuilder

Create a new FTheadCommentItem

参数

参数类型描述
comment?IThreadCommentThe comment

返回

FTheadCommentBuilder

A new instance of FTheadCommentItem

示例

const comment = univerAPI.newTheadComment();

重写了

FTheadCommentItem.create