I am building a vanilla web component and using it in aurelia but having some odd behaviour on the slot
I have a fixed structure and want the children of the custom element to be placed in a particular place in the web component structure.
I don’t really want to import any aurelia spesific code here because I want reuse with out any framework. In theory if I implement a native shadow dom implementation, should I expect this to work?
I don’t currently so that would make sense.
By default Aurelia assumes you wanna use simulation of <slot/>, as by the time it was created, the slot spec was not stable, and browser support wasn’t good.
The decorator is to tell Aurelia to not use the simulation, and decorating your class with @useShadowDOM doesn’t make make it not reusable.
If your use-case is to not use @useShadowDOM because you don’t want to import anything from Aurelia, then just simply take a look at its implementation here. It’s just a decorator that essentially adds targetShadowDOM and shadowDOMOptions statically which you could do by yourself.