forked from sveltejs/svelte.dev
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
11d7465
commit 7fedd8d
Showing
13 changed files
with
39 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
14 changes: 9 additions & 5 deletions
14
apps/svelte.dev/content/tutorial/01-svelte/05-events/01-dom-events/index.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,25 @@ | ||
--- | ||
title: DOM events | ||
title: Évènements DOM | ||
--- | ||
|
||
As we've briefly seen already, you can listen to any DOM event on an element (such as click or [pointermove](https://developer.mozilla.org/en-US/docs/Web/API/Element/pointermove_event)) with an `on<name>` function: | ||
Comme nous l'avons vu rapidement, vous pouvez écouter n'importe quel évènement sur un élément (comme | ||
un `click` ou un | ||
[`pointermove`](https://developer.mozilla.org/en-US/docs/Web/API/Element/pointermove_event)) avec | ||
une fonction `on<nom>` : | ||
|
||
```svelte | ||
/// file: App.svelte | ||
<div +++onpointermove={onpointermove}+++> | ||
The pointer is at {Math.round(m.x)} x {Math.round(m.y)} | ||
Le pointeur se trouve à la position {Math.round(m.x)} x {Math.round(m.y)} | ||
</div> | ||
``` | ||
|
||
Like with any other property where the name matches the value, we can use the short form: | ||
Comme avec toute autre propriété dont le nom correspond à la valeur, nous pouvons utiliser la forme | ||
raccourcie : | ||
|
||
```svelte | ||
/// file: App.svelte | ||
<div +++{onpointermove}+++> | ||
The pointer is at {Math.round(m.x)} x {Math.round(m.y)} | ||
Le pointeur se trouve à la position {Math.round(m.x)} x {Math.round(m.y)} | ||
</div> | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,7 +3,7 @@ | |
</script> | ||
|
||
<button> | ||
Push | ||
Appuyer | ||
</button> | ||
|
||
<style> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,7 +3,7 @@ | |
</script> | ||
|
||
<button {...props}> | ||
Push | ||
Appuyer | ||
</button> | ||
|
||
<style> | ||
|
6 changes: 4 additions & 2 deletions
6
apps/svelte.dev/content/tutorial/01-svelte/05-events/05-spreading-events/index.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
--- | ||
title: Events | ||
title: Évènements | ||
scope: { 'prefix': '/src/lib/', 'name': 'src' } | ||
focus: /src/lib/App.svelte | ||
--- |