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
@@ -276,7 +276,7 @@ Now, if we use our `ErrorDialog` component without a block, we'll get the
276
276
default message.
277
277
278
278
```gjs
279
-
import ErrorDialog from './error-dialog.gjs';
279
+
import ErrorDialog from 'my-app/components/error-dialog';
280
280
281
281
<template>
282
282
<ErrorDialog/>
@@ -293,8 +293,8 @@ If we had a more detailed message, though, we could use the block to pass it to
293
293
the dialog.
294
294
295
295
```gjs
296
-
import ErrorDialog from './error-dialog.gjs';
297
-
import Icon from './icon.gjs';
296
+
import ErrorDialog from 'my-app/components/error-dialog';
297
+
import Icon from 'my-app/components/icon';
298
298
299
299
<template>
300
300
<ErrorDialog>
@@ -319,7 +319,7 @@ function in JavaScript. Consider for instance a simple `BlogPost` component.
319
319
```
320
320
321
321
```gjs
322
-
import BlogPost from './blog-post.gjs';
322
+
import BlogPost from 'my-app/components/blog-post';
323
323
324
324
<template>
325
325
<!-- usage -->
@@ -342,8 +342,8 @@ to them.
342
342
```
343
343
344
344
```gjs
345
-
import BlogPost from './blog-post.gjs';
346
-
import AuthorBio from './author-bio.gjs';
345
+
import BlogPost from 'my-app/components/blog-post';
346
+
import AuthorBio from 'my-app/components/author-bio';
347
347
348
348
<template>
349
349
<!-- usage -->
@@ -366,8 +366,8 @@ We can yield back multiple values as well, separated by spaces.
366
366
```
367
367
368
368
```gjs
369
-
import BlogPost from './blog-post.gjs';
370
-
import AuthorBio from './author-bio.gjs';
369
+
import BlogPost from 'my-app/components/blog-post';
370
+
import AuthorBio from 'my-app/components/author-bio';
371
371
372
372
<template>
373
373
<!-- usage -->
@@ -415,7 +415,7 @@ Without named blocks, we would certainly have to pass components as `args` to th
415
415
Here’s how we would call our named blocks as a consumer:
416
416
417
417
```gjs
418
-
import Popover from './popover.gjs';
418
+
import Popover from 'my-app/components/popover';
419
419
420
420
<template>
421
421
<Popover>
@@ -465,7 +465,7 @@ Don't worry, you can also still use `yield` by itself, and mix it with named blo
465
465
A yielded block without a name is called `default`. So to access it, it’s like any other named blocks.
466
466
467
467
```gjs
468
-
import Card from './card.gjs';
468
+
import Card from 'my-app/components/card';
469
469
470
470
<template>
471
471
<Card>
@@ -482,7 +482,7 @@ import Card from './card.gjs';
482
482
The title being optional when you create a card, you can use the `(has-block)` helper with the named block by adding its name as a first parameter. That means you could also create this card:
Copy file name to clipboardExpand all lines: guides/release/components/component-state-and-actions.md
+4-4Lines changed: 4 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,7 +6,7 @@ JavaScript to make your application interactive.
6
6
<div class="cta-note-body">
7
7
<div class="cta-note-heading">Zoey says...</div>
8
8
<div class="cta-note-message">
9
-
Until now, we've been using template-only components. That is, our `.gjs` component files have consisted of a single `<template>` tag with our markup inside. Now, we're going to add a class. For a more thorough discussion of how `.gjs` files define components, see the section on <strong>template tag format</strong>.
9
+
Until now, we've been using template-only components. That is, our `.gjs` component files have consisted of a single `<template>` tag with our markup inside. Now, we're going to add a class. For a more thorough discussion of how `.gjs` files define components, see the section on <a href="../template-tag-format/">template tag format</a>.
import MessageUsername from './message/username.gjs';
8
+
import MessageAvatar from 'my-app/components/message/avatar';
9
+
import MessageUsername from 'my-app/components/message/username';
10
10
11
11
<template>
12
12
<MessageAvatar
@@ -27,7 +27,7 @@ import MessageUsername from './message/username.gjs';
27
27
```
28
28
29
29
```gjs
30
-
import Message from './message.gjs';
30
+
import Message from 'my-app/components/message';
31
31
32
32
<template>
33
33
<Message
@@ -52,8 +52,8 @@ Let's update the component to do that. It'll take a `@username` argument and cal
52
52
Since the title is just the `@username` plus some extra stuff, we can replace `@avatarTitle` by _interpolating_ the `@username` argument in a string literal passed to `<Message::Avatar>`.
0 commit comments