From b5cb00d26fa4aee0766a382a8326d5e1b5cb458b Mon Sep 17 00:00:00 2001 From: Ayo Date: Fri, 20 Oct 2023 12:14:20 +0200 Subject: [PATCH] chore: update samples in readme --- README.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 0eb5d54..e70b0b0 100644 --- a/README.md +++ b/README.md @@ -98,7 +98,7 @@ This mental model attempts to reduce the cognitive complexity of authoring compo Attributes are generally in `kebab-case`. You can access attribute properties in two ways 1. Use the camelCase counterpart: `this.myProp`, which is automatically filled. -1. Or stick with kebab-case: `this[my-prop]` +1. Or stick with kebab-case: `this["my-prop"]` ```js class HelloWorld extends WebComponent { @@ -107,7 +107,7 @@ class HelloWorld extends WebComponent { get template() { return `

Hello ${this.myProp}

-

Hello ${this['my-prop']}

+

Hello ${this["my-prop"]}

`; } } @@ -130,10 +130,10 @@ Here is an example of using a custom element in a single .html file: import WebComponent from "https://unpkg.com/web-component-base/index.js"; class HelloWorld extends WebComponent { - static properties = ["name"]; + static properties = ["data-name"]; get template() { - return `

Hello ${this.name || 'World'}!

`; + return `

Hello ${this.dataName || 'World'}!

`; } }