Classes
Methods
# inner componentOf(ElementClass)
// Unminified
import { componentOf } from 'https://fancy-pants.js.org/component.js';
// Minified
import { componentOf } from 'https://fancy-pants.js.org/min/component.js';
Construct a Component class that extends from a specific kind of HTMLElement. Use this if you want a custom element to work like a Component but extend from a more specific type.
class MyComponent extends componentOf(HTMLParagraphElement) {
…
}
MyComponent.register();
Parameters:
Name | Type | Description |
---|---|---|
ElementClass |
HTMLElement | the HTMLElement the component class will extend from |
Component a FancyPants component that extends from ElementClass