update base class, add link to reference
This commit is contained in:
parent
51143163c8
commit
488cd8da5a
3 changed files with 10 additions and 2 deletions
|
@ -97,7 +97,7 @@ async function buildRegistry(usedCustomElements: string[], type: "js" | "ts") {
|
|||
!isBaseClassImported &&
|
||||
content.toString().includes("extends WebComponent")
|
||||
) {
|
||||
const baseClassImport = `import { WebComponent } from "https://unpkg.com/web-component-base@1.7.1/WebComponent.mjs";`;
|
||||
const baseClassImport = `import { WebComponent } from "https://unpkg.com/web-component-base@1.9.1/WebComponent.mjs";`;
|
||||
|
||||
registryScript += baseClassImport;
|
||||
isBaseClassImported = true;
|
||||
|
|
|
@ -1,3 +1,7 @@
|
|||
/**
|
||||
* Custom element using a minimal Web Component Base class
|
||||
* @see https://ayco.io/n/web-component-base
|
||||
*/
|
||||
class ClickableText extends WebComponent {
|
||||
onInit() {
|
||||
this.onclick = () => alert("Thank you for clicking the text!");
|
||||
|
|
|
@ -1,3 +1,7 @@
|
|||
/**
|
||||
* Custom element using a minimal Web Component Base class
|
||||
* @see https://ayco.io/n/web-component-base
|
||||
*/
|
||||
class HelloWorld extends WebComponent {
|
||||
static properties = ["data-name"];
|
||||
|
||||
|
@ -10,6 +14,6 @@ class HelloWorld extends WebComponent {
|
|||
}
|
||||
|
||||
get template() {
|
||||
return `<button style="cursor:pointer">Hello ${this["data-name"]}!</button>`;
|
||||
return `<button style="cursor:pointer">Hello ${this.dataName}!</button>`;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue