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
@@ -30,7 +30,7 @@ This layout can be turned into a template tag component by wrapping the code in
30
30
31
31
The top-level template tag is exported as default component from the file. You *can* write this export explicitly, but it's not necessary. The following example is equivalent to the previous one.
A `<template>` tag can also be embedded inside a class definition of a component. This is useful when you need to add state or other logic to your component. Take for example the following "Avatar" component, where a default title is added when the `title` argument is not provided.
@@ -66,7 +66,7 @@ The template tag format uses strict template semantics. This means that you can
66
66
67
67
When making use of the "Avatar" component as defined before in a different component file, it first needs to be imported. This is done using the `import` statement, just like you would import any other JavaScript module.
@@ -172,7 +173,7 @@ The template tag format follows JavaScript module syntax. Any value that isn't e
172
173
173
174
In the following example, a "Square" component is defined that calculates the square of a number. The `value` constant is defined locally, and the `square` helper function is only available within the component.
@@ -192,7 +193,7 @@ The template tag format allows defining multiple components within a single file
192
193
193
194
The following example defines a "CustomSelect" component that renders a `<select>` element with a list of options. The locally-defined "Option" component is used to render each option in the list.
0 commit comments