You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: docs/components/defining.md
+5-5
Original file line number
Diff line number
Diff line change
@@ -5,7 +5,7 @@ Define a Jwc component by creating a class that extends `JwcComponent` or a func
5
5
::: code-group
6
6
7
7
```tsx [Class Based]
8
-
@JwcComponent({ name: "app-element" })
8
+
@Component({ name: "app-element" })
9
9
exportclassAppextendsJwcComponent {
10
10
/* ... */
11
11
}
@@ -19,13 +19,13 @@ export class App extends JwcComponent {
19
19
20
20
## Class Based
21
21
22
-
The `@JwcComponent` decorator is used to define a Jwc component. It takes an object with the following properties:
22
+
The `@Component` decorator is used to define a Jwc component. It takes an object with the following properties:
23
23
24
24
-`name` - The name of the component. This is used to identify the component in the DOM. It must be unique.
25
25
-[`css`](./styles.md) - The CSS to be applied to the component. The CSS is applied to the shadow DOM of the component.
26
26
-`options` - The options to be passed to the component. Follows the ElementDefinitionOptions interface from the [Custom Elements API](https://developer.mozilla.org/en-US/docs/Web/API/CustomElementRegistry/define#Parameters).
27
27
28
-
I recommend you do not use JavaScript to define your component. Instead, use TypeScript. This will allow you to use the `@JwcComponent` decorator to define your component.
28
+
I recommend you do not use JavaScript to define your component. Instead, use TypeScript. This will allow you to use the `@Component` decorator to define your component.
29
29
30
30
But if you do use JavaScript or you want to define without using the decorator:
31
31
@@ -35,7 +35,7 @@ But if you do use JavaScript or you want to define without using the decorator:
0 commit comments