Add mini.js as minimalist node creation helper
This commit is contained in:
parent
d33b6fd177
commit
be2cbee5e6
1 changed files with 7 additions and 0 deletions
7
mini.js
Normal file
7
mini.js
Normal file
|
@ -0,0 +1,7 @@
|
|||
export default new Proxy(document, {
|
||||
get: (_, tag) => content => {
|
||||
let node = document.createElement(tag)
|
||||
for (let key in content) node[key] = content[key]
|
||||
return node
|
||||
}
|
||||
})
|
Loading…
Reference in a new issue