本文整理匯總了TypeScript中@rich-editor/quill/blots/blocks/ListBlot.ListItem類的典型用法代碼示例。如果您正苦於以下問題:TypeScript ListItem類的具體用法?TypeScript ListItem怎麽用?TypeScript ListItem使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
在下文中一共展示了ListItem類的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。
示例1: it
it("always reports it's value in the new object style", () => {
insertListBlot("ordered");
insertListBlot("bullet");
const expected = [
{ insert: "list item" },
{
attributes: {
list: {
type: ListType.ORDERED,
depth: 0,
},
},
insert: "\n",
},
{ insert: "list item" },
{
attributes: {
list: {
type: ListType.BULLETED,
depth: 0,
},
},
insert: "\n",
},
];
expect(quill.getContents().ops).deep.equals(expected);
});
示例2: insertListBlot
const testAutoJoining = (depth: number, type: ListType.BULLETED) => {
insertListBlot({ type, depth });
insertListBlot({ type, depth });
insertListBlot({ type, depth });
const listGroup = quill.scroll.children.tail as ListGroup;
expect(quill.scroll.children.tail).eq(quill.scroll.children.head);
expect(listGroup).instanceOf(ListGroup);
expect(listGroup.children).has.length(3);
resetQuill();
};