diff --git a/README.md b/README.md index a9d75ce..eb0125c 100644 --- a/README.md +++ b/README.md @@ -148,14 +148,21 @@ isolation. ### Component API -These attributes can be used to provide logic for different life cycle events of your component. They follow the -standard API for Web Components. +These attributes can be used to provide or inherit logic for different life cycle events of your component. They follow +the standard API for Web Components.
+
td-extends="tag-name"
+
+ +Attribute to be used on the top-level definition tag. The class associated with the `tag-name` will be used as a parent +class when building this Web Component definition. That tag must be already registered in the `customElements` registry. + +
td-property="propertyName"
-Attribute to be used on a `script` tag in your component definition. This assigned property name will be attached to the +Attribute to be used on a `script` tag in your component definition. The assigned property name will be attached to the element as a static property, and can be useful for adding `observedAttributes`, `formAssociated`, `disableInternals`, or `disableShadow`. You can also define custom static properties for your element. @@ -168,6 +175,11 @@ element, and can be useful for adding to the `constructor`, or setting other Web `connectedCallback`, `disconnectedCallback`, `adoptedCallback`, or `attributeChangedCallback`. You can also define custom methods for your element. +> [!tip] +> +> If you are using `attributeChangedCallback` you can access the parameters (`name`, `oldValue`, and `newValue`) using +> the `arguments` keyword. See the example below to see how this works! +
@@ -198,8 +210,11 @@ custom methods for your element. diff --git a/example/index.html b/example/index.html index f9e4a56..80da772 100644 --- a/example/index.html +++ b/example/index.html @@ -73,7 +73,10 @@

@@ -102,10 +105,61 @@

+ + + + + + + + + + + + + + + + + + + + + +