11ty / eleventy-plugin-webc

Adds support for WebC *.webc files to Eleventy
https://www.11ty.dev/docs/languages/webc/
119 stars 10 forks source link

Docs: Using WebC for behavior-only (“wrapper”) components #74

Open Zearin opened 1 year ago

Zearin commented 1 year ago

It’s been a while since I used Vue, but from what I remember there were some components that could define only behavior—no markup—which could then be used to wrap other components. For example:

<behavior-enhancing-component>
    <typical-component></typical-component>
</behavior-enhancing-component>

If this is possible, can you add some docs about it?

Zearin commented 1 year ago

I think the answer to my question is: Yes.

I found an excellent resource here: https://thomaswilburn.github.io/wc-book/sd-behavioral.html

That said: this pattern was important enough for its own book chapter in the above link, as well as in frameworks like Vue. The WebC docs should probably cover this topic, even if just lightly.