So I know the x-tag web component library enables you create custom elements that appear in HTML like this:
<x-my-custom-element>my content</x-my-custom-element>
However, what if I wanted to create multiple custom sub-elements, like this:
<x-my-custom-element>
<x-my-custom-element-child>
<x-my-custom-element-grandchild></x-my-custom-element-grandchild>
</x-my-custom-element-child>
</x-my-custom-element>
Is the right way to simply call xtag.register()
three times, like so:
xtag.register('x-my-custom-element', {...});
xtag.register('x-my-custom-element-child', {...});
xtag.register('x-my-custom-element-grandchild', {...});
Also, is there any way to force a sub-element to always be a child of another element? In other words, this would work:
<x-my-custom-element-parent>
<x-my-custom-element-child></x-my-custom-element-child>
</x-my-custom-element-parent>
but this wouldn't:
<x-my-custom-element-child>
<x-my-custom-element-parent></x-my-custom-element-parent>
</x-my-custom-element-child>