We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
html
1 parent 39e0bb4 commit 7bc7630Copy full SHA for 7bc7630
src/component.js
@@ -22,6 +22,10 @@ export default {
22
name: {
23
type: String,
24
default: () => Math.floor(Date.now() * Math.random()).toString(16)
25
+ },
26
+ html: {
27
+ type: String,
28
+ default: null
29
}
30
},
31
@@ -55,6 +59,16 @@ export default {
55
59
56
60
tpl.appendChild(tail)
57
61
62
+ // embed html
63
+ if (this.html) {
64
+ let template = document.createElement('template')
65
+ template.innerHTML = this.html
66
+ // copy elements over
67
+ Array.from(template.content.childNodes).forEach(node => {
68
+ tpl.appendChild(node)
69
+ })
70
+ }
71
+
58
72
let next = container.nextSibling
73
parent.insertBefore(tpl, container, true)
74
parent.removeChild(container)
0 commit comments