本文整理匯總了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");
});