addComment()
描述
通过卡片的 ID 向指定卡片添加新的评论
用法
addComment({
id?: string | number,
cardId: string | number,
comment: {
text?: string,
date?: Date,
html?: string
}
}): void;
参数
id- (可选)新评论的 IDcardId- (必填)要添加评论的卡片 IDcomment- (必填)新评论的配置对象。您可以在此指定以下参数:text- (可选)新评论的文本内容date- (可选)新评论的日期html- (可选)新评论的 HTML 标记。启用editorShape配置中的html属性,以显示 HTML 标记而非文本
示例
// 创建看板
const board = new kanban.Kanban("#root", {
columns,
cards
});
// 添加新评论
board.addComment({
id: 1,
cardId: 1,
comment: {
text: "",
date: new Date("01/07/2021"),
html: "<b>重要评论</b>"
}
});
更新日志: 此方法自 v1.4 版本起添加