fix(runtome-dom): properly support creating customized built-in element

This commit is contained in:
Evan You
2020-03-27 12:38:47 -04:00
parent 412ec86128
commit b1d0b046af
3 changed files with 34 additions and 4 deletions

View File

@@ -22,8 +22,10 @@ export const nodeOps: Omit<RendererOptions<Node, Element>, 'patchProp'> = {
}
},
createElement: (tag, isSVG): Element =>
isSVG ? doc.createElementNS(svgNS, tag) : doc.createElement(tag),
createElement: (tag, isSVG, is): Element =>
isSVG
? doc.createElementNS(svgNS, tag)
: doc.createElement(tag, is ? { is } : undefined),
createText: text => doc.createTextNode(text),