Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
import { withChildren } from 'skatejs';
class WithChildren extends withChildren() {
childrenUpdated() {
const len = this.children.length;
this.attachShadow({ mode: 'open' }).innerHTML = `This element has ${len} ${
len === 1 ? 'child' : 'children'
}!`;
}
}
customElements.define('with-children', WithChildren);
import { withChildren } from 'skatejs';
class WithChildren extends withChildren() {
childrenUpdated() {
const len = this.children.length;
this.attachShadow({
mode: 'open'
}).innerHTML = `This element has ${len} ${
len === 1 ? 'child' : 'children'
}!`;
}
}
customElements.define('with-children1', WithChildren);