Skip to content

Commit

Permalink
docs: multiple event listeners on single node (#2825)
Browse files Browse the repository at this point in the history
  • Loading branch information
ematipico authored and Conduitry committed May 20, 2019
1 parent 1e91911 commit 394a166
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions site/content/docs/02-template-syntax.md
Original file line number Diff line number Diff line change
Expand Up @@ -351,6 +351,24 @@ If the `on:` directive is used without a value, the component will *forward* the
</button>
```

---

It's possible to have multiple event listeners for the same event:

```html
<script>
let counter = 0;
function increment() {
counter = counter + 1;
}
function track(event) {
trackEvent(event)
}
</script>

<button on:click={increment} on:click={track}>Click me!</button>
```

### Component events

Expand Down

0 comments on commit 394a166

Please sign in to comment.