Closed UpperCod closed 4 years ago
This new version stabilizes the api by introducing various changes and tests to guarantee the future stability of Atomico.
custom Element
c
the c function is only limited just create the Element to be registered by customElements.define, example:
customElements.define
import { h, c } from "atomico"; const MyComponent = () => <host />; const HTMLMyComponent = c(MyComponent); customElements.define("my-component", HTMLMyComponent);
This function also allows modifying the class to be used as the basis for the Atomico component, example:
const HTMLMyComponent = c(MyComponent, HTMLAnchorElement);
Using the host tag you can define methods that work with the scope of the web component, example:
host
const MyComponent = () => { const myMethod = () => console.log("hi!"); return <host myMethod={myMethod}>...</host>; }; // After registration let myComponent = document.querySelector("my-component"); await myComponent.updated; myComponent.myMethod();
Atomico@1.0.0-beta
This new version stabilizes the api by introducing various changes and tests to guarantee the future stability of Atomico.
Break!
custom Element
is replaced by thec
function.the
c
function is only limited just create the Element to be registered bycustomElements.define
, example:This function also allows modifying the class to be used as the basis for the Atomico component, example:
Improvements
Support is added to methods.
Using the
host
tag you can define methods that work with the scope of the web component, example:Security
customElements.define
, example: