Allow passing of nodes directly to UIFragment.html
This commit is contained in:
parent
fb83b0e524
commit
431a7f49b0
|
@ -501,8 +501,11 @@ export class Anchor {
|
|||
return new Anchor({ fragmentId: this.fragmentId + '__' + extn });
|
||||
}
|
||||
|
||||
html(selector: string, html: HtmlFragments, orderBy: NodeOrderKey = ''): ReturnType<typeof P.UIFragment> {
|
||||
return P.UIFragment(this.fragmentId, selector, embed(create ({ data: html.nodes() })), orderBy);
|
||||
html(selector: string, html: HtmlFragments | Array<ChildNode>, orderBy: NodeOrderKey = ''): ReturnType<typeof P.UIFragment> {
|
||||
if (!Array.isArray(html)) {
|
||||
html = html.nodes();
|
||||
}
|
||||
return P.UIFragment(this.fragmentId, selector, embed(create ({ data: html })), orderBy);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue