[DOC] add dedicated page on event handling

part of #632
This commit is contained in:
Géry Debongnie
2020-02-15 10:18:12 +01:00
parent 69d35abe4f
commit 047a9c8993
7 changed files with 141 additions and 127 deletions
+1 -1
View File
@@ -124,7 +124,7 @@ class Parent extends Component {
In this example, the `OrderLine` component trigger a `add-to-order` event. This
will generate a DOM event which will bubble along the DOM tree. It will then be
intercepted by the parent component, which will then get the line (from the
`detail` key) and then increment its quantity. See the section on [event handling](../reference/component.md#event-handling)
`detail` key) and then increment its quantity. See the page on [event handling](../reference/event_handling.md)
for more details on how events work.
Note that this example would have also worked if the `OrderLine` component
+1 -1
View File
@@ -446,7 +446,7 @@ Now, this is an interesting situation: the task is displayed by the `Task`
component, but it is not the owner of its state, so it cannot modify it. Instead,
we want to communicate the request to toggle a task to the `App` component.
Since `App` is a parent of `Task`, we can
[trigger](../reference/component.md#event-handling) an event in `Task` and listen
[trigger](../reference/event_handling.md) an event in `Task` and listen
for it in `App`.
In `Task`, change the `input` to: