Add special case for dataset to skooma templating
This commit is contained in:
parent
bf50ea22dc
commit
12edc1890e
1 changed files with 3 additions and 0 deletions
|
@ -50,6 +50,9 @@ const parseArgs = (element, before, ...args) => {
|
||||||
for (let key in arg)
|
for (let key in arg)
|
||||||
if (key == "style" && typeof(arg[key])=="object")
|
if (key == "style" && typeof(arg[key])=="object")
|
||||||
insertStyles(element.style, arg[key])
|
insertStyles(element.style, arg[key])
|
||||||
|
else if (key == "dataset" && typeof(arg[key])=="object")
|
||||||
|
for (let [key2, value] of Object.entries(arg[key]))
|
||||||
|
element.dataset[key2] = parseAttribute(value)
|
||||||
else if (key == "shadowRoot")
|
else if (key == "shadowRoot")
|
||||||
parseArgs((element.shadowRoot || element.attachShadow({mode: "open"})), null, arg[key])
|
parseArgs((element.shadowRoot || element.attachShadow({mode: "open"})), null, arg[key])
|
||||||
else if (typeof arg[key] === "function")
|
else if (typeof arg[key] === "function")
|
||||||
|
|
Loading…
Reference in a new issue