Skip to content

Commit 7ea6eed

Browse files
authored
docs: tweak a few lessons (sveltejs#390)
1 parent 1cb7d1c commit 7ea6eed

File tree

6 files changed

+9
-8
lines changed

6 files changed

+9
-8
lines changed

content/tutorial/01-svelte/04-logic/01-if-blocks/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,4 @@ To conditionally render some markup, we wrap it in an `if` block. Let's add some
1818
{/if}+++
1919
```
2020

21-
Try it — update the component, and click on the buttons.
21+
Try it — update the component, and click on the button.

content/tutorial/01-svelte/05-events/04-component-events/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,4 +28,4 @@ Then, add an `on:message` handler in `App.svelte`:
2828
<Inner +++on:message={handleMessage}+++ />
2929
```
3030

31-
> You can also try changing the event name to something else. For instance, change `dispatch('message')` to `dispatch('greet')` in `Inner.svelte` and change the attribute name from `on:message` to `on:greet` in `App.svelte`.
31+
> You can also try changing the event name to something else. For instance, change `dispatch('message', {...})` to `dispatch('greet', {...})` in `Inner.svelte` and change the attribute name from `on:message` to `on:greet` in `App.svelte`.

content/tutorial/02-advanced-svelte/02-transitions/08-key-blocks/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ title: Key blocks
44

55
Key blocks destroy and recreate their contents when the value of an expression changes. This is useful if you want an element to play its transition whenever a value changes instead of only when the element enters or leaves the DOM.
66

7-
Here, for example, we'd like to play the `typewriter` transition from `transition.js` whenever the loading message changes. Wrap the `<p>` element in a key block:
7+
Here, for example, we'd like to play the `typewriter` transition from `transition.js` whenever the loading message, i.e. `i` changes. Wrap the `<p>` element in a key block:
88

99
```svelte
1010
/// file: App.svelte

content/tutorial/02-advanced-svelte/05-bindings/03-media-elements/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@ title: Media elements
44

55
You can bind to properties of `<audio>` and `<video>` elements, making it easy to (for example) build custom player UI, like `AudioPlayer.svelte`.
66

7-
First, add the `<audio>` element along with its bindings (we'll use the shorthand form for `duration` and `paused`):
7+
First, add the `<audio>` element along with its bindings (we'll use the shorthand form for `src`, `duration` and `paused`):
88

99
```svelte
1010
/// file: AudioPlayer.svelte
1111
<div class="player" class:paused>
1212
+++ <audio
13-
src={src}
13+
{src}
1414
bind:currentTime={time}
1515
bind:duration
1616
bind:paused
@@ -53,7 +53,7 @@ When the track ends, be kind — rewind:
5353
```svelte
5454
/// file: AudioPlayer.svelte
5555
<audio
56-
src={src}
56+
{src}
5757
bind:currentTime={time}
5858
bind:duration
5959
bind:paused

content/tutorial/02-advanced-svelte/05-bindings/03-media-elements/app-b/src/lib/AudioPlayer.svelte

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919

2020
<div class="player" class:paused>
2121
<audio
22-
src={src}
22+
{src}
2323
bind:currentTime={time}
2424
bind:duration
2525
bind:paused

content/tutorial/02-advanced-svelte/05-bindings/04-dimensions/README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@ Every block-level element has `clientWidth`, `clientHeight`, `offsetWidth` and `
77
```svelte
88
/// file: App.svelte
99
<div +++bind:clientWidth={w} bind:clientHeight={h}+++>
10-
<span style="font-size: {size}px">{text}</span>
10+
<span style="font-size: {size}px" contenteditable>{text}</span>
11+
<span class="size">{w} x {h}px</span>
1112
</div>
1213
```
1314

0 commit comments

Comments
 (0)