类: 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
参数
参数 | 类型 | 描述 |
---|---|---|
content | any | The content of the comment |
返回
The comment builder
示例
const comment = univerAPI.newTheadComment()
.setContent(univerAPI.newRichText().insertText('hello zhangsan'));
setDateTime()
setDateTime(date): FTheadCommentBuilder
Set the date time of the comment
参数
参数 | 类型 | 描述 |
---|---|---|
date | Date | The date time of the comment |
返回
The comment builder
示例
const comment = univerAPI.newTheadComment()
.setDateTime(new Date());
setId()
setId(id): FTheadCommentBuilder
Set the id of the comment
参数
参数 | 类型 | 描述 |
---|---|---|
id | string | The id of the comment |
返回
The comment builder
示例
const comment = univerAPI.newTheadComment()
.setId('123');
setPersonId()
setPersonId(userId): FTheadCommentBuilder
Set the person id of the comment
参数
参数 | 类型 | 描述 |
---|---|---|
userId | string | The person id of the comment |
返回
The comment builder
示例
const comment = univerAPI.newTheadComment()
.setPersonId('123');
setThreadId()
setThreadId(threadId): FTheadCommentBuilder
Set the thread id of the comment
参数
参数 | 类型 | 描述 |
---|---|---|
threadId | string | The thread id of the comment |
返回
The comment builder
示例
const comment = univerAPI.newTheadComment()
.setThreadId('123');
create()
static create(comment?): FTheadCommentBuilder
Create a new FTheadCommentItem
参数
参数 | 类型 | 描述 |
---|---|---|
comment ? | IThreadComment | The comment |
返回
A new instance of FTheadCommentItem
示例
const comment = univerAPI.newTheadComment();
重写了
FTheadCommentItem.create