Open RoXuS opened 2 years ago
Is it intended to have a tagName in pascal/camel case like in react ? In my vision, all tag names should be kebab cased. If so, maybe we just could convert pascalized tag name to kebab case.
Other solution is to use Class.name property, or static get is, but it seems unset when one uses @customElement
Yes but technically we don't have to use @customElements with scopedElementMixin so we will not have customElements too.
Maybe add a static defaultTagName
?
It will be used if a scopedElement is not defined with a tag name.
could look something like this:
class DtTooltip extends HTMLElement {
static defaultTagName = 'dt-tooltip';
}
class MyEl extends ScopedElementsMixin(LitElement) {
static get scopedElements() {
return {
DtTooltip,
}
}
render() {
return html`
<dt-tooltip>Hello World</dt-tooltip>
`;
}
}
yeah it's a good solution for us but that it's not a generic thing...
@daKmoR if the polyfill supported something like that it should probably be hashed out as a WCCG community protocol. Some other utilities I've seen look for a static tagName
or is
property.
90% of the time we don’t change the tagName of the component.
Maybe it should be a good idea to add a “mode” on scopedElements to avoid tagName?
Something like: