11ty / webc

Single File Web Components
MIT License
1.3k stars 36 forks source link

`@attributes` not allowing `-` hypenated attributes #178

Open zeroedin opened 1 year ago

zeroedin commented 1 year ago

Example: <some-component full-width>

template:

<div @attributes="({bordered, full-width})"`>

Error:

[11ty] Problem writing Eleventy templates: (more in DEBUG output)
[11ty] 1. Having trouble rendering webc template ./site/backpage.webc (via TemplateContentRenderError)
[11ty] 2. Check the dynamic attribute: `@attributes="({bordered, full-width})"`.
[11ty] Original error message: Unexpected token '-' (via Error)

Accessing via a camelCase almost seems to work but then removes the - from the output:

template:

<div @attributes="({bordered, fullWidth)"`>

output:

<div fullwidth="">