列表项块
列表项块用于在文档中创建不同类型的列表。BlockNote 支持各种列表项块,帮助您有效地构建和格式化内容。
项目符号列表项
项目符号列表项是不带编号的列表项。
类型与属性
type BulletListItemBlock = {
id: string;
type: "bulletListItem";
props: DefaultProps;
content: InlineContent[];
children: Block[];
};编号列表项
编号列表项是带编号的列表项。
类型与属性
type NumberedListItemBlock = {
id: string;
type: "numberedListItem";
props: DefaultProps & {
start?: number;
};
content: InlineContent[];
children: Block[];
};start: 该列表项的编号。如果未提供,默认值为 1,或自动递增。
复选列表项
复选列表项是可勾选或取消勾选的列表项。
类型与属性
type CheckListItemBlock = {
id: string;
type: "checkListItem";
props: DefaultProps & {
checked: boolean;
};
content: InlineContent[];
children: Block[];
};checked: 表示该列表项是否被勾选。
切换列表项
切换列表项是可以显示或隐藏其子项的列表项。
类型与属性
type ToggleListItemBlock = {
id: string;
type: "toggleListItem";
props: DefaultProps;
content: InlineContent[];
children: Block[];
};