generator-backed-element
Version:
> The official Backed element generator
43 lines (40 loc) • 883 B
HTML
<template id="<%= name %>">
<style>
:host {
display: flex;
}
</style>
<slot></slot>
</template>
<script>/**
* A trying to be useful element!
* @extends HTMLElement
*
*
* Info about callbacks can be found at
* https://github.com/VandeurenGlenn/backed/wiki/Lifecycle-callback-methods
*/
Backed(class <%= className %> extends HTMLElement {
/**
* Element has been created (upgraded)
*/
created() {
// Useful for initializing state, settings up event listeners, etc
// When not using backed, you would setup shadow dom here also.
}
/**
* Element has been inserted into the DOM.
*/
connected() {
// shadowRoot, pusbSub, fireEvent, toJsProp etc are ready to use ...
}
/**
* Element is ready to ROCK!
*/
ready() {
// this is where you start using your properties, observers, etc
}
});
;
</script>