11ty / webc

Single File Web Components
MIT License
1.32k stars 38 forks source link

Slottable content was using the wrong component definition for `<script webc:setup>` and global data context #157

Closed zachleat closed 1 year ago

zachleat commented 1 year ago
<script webc:setup>
const globalData = 1
</script>
<my-component>
  <!-- this was broken, but should work without using `$data.globalData` -->
  <span @text="globalData"></span>
</my-component>
zachleat commented 1 year ago

Fixed by 6e5aeb3e6d5b7951e09b2c553f1a02fa674ae9d6

mirisuzanne commented 8 months ago

@zachleat I'm running into this on version 0.11.2 - data added to the setup is not available when wrapped by another component.