本文整理汇总了TypeScript中wed/mode-tree.ModeTree.getWedOptions方法的典型用法代码示例。如果您正苦于以下问题:TypeScript ModeTree.getWedOptions方法的具体用法?TypeScript ModeTree.getWedOptions怎么用?TypeScript ModeTree.getWedOptions使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类wed/mode-tree.ModeTree
的用法示例。
在下文中一共展示了ModeTree.getWedOptions方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: expect
() => {
const ps = editor.dataRoot.querySelectorAll("p");
const opts = tree.getWedOptions(ps[0]);
expect(opts).to.have.nested.property("metadata.name")
.equal("Test1");
for (const p of Array.from(ps)) {
expect(opts).to.equal(tree.getWedOptions(p));
}
});
示例2: it
it("constrain submodes to the region of their parent mode", () => {
// We have set a submode that matches teiHeader but that submode is a
// child of a mode that matches p. The one teiHeader in the document is
// not a child of p and so should not match the submode. teiHeader should
// be governed by the top mode.
const el = editor.dataRoot.querySelector("teiHeader")!;
const opts = tree.getWedOptions(el);
expect(opts).to.have.nested.property("metadata.name").equal("Generic");
});