Unterschiede
Hier werden die Unterschiede zwischen zwei Versionen angezeigt.
| Nächste Überarbeitung | Vorhergehende Überarbeitung | ||
| en:modul:m291:learningunits:lu06:theorie:01 [2025/04/10 09:51] – angelegt vdemir | en:modul:m291:learningunits:lu06:theorie:01 [2025/04/25 10:17] (aktuell) – vdemir | ||
|---|---|---|---|
| Zeile 1: | Zeile 1: | ||
| - | ====== | + | ====== |
| ===== Learning ojectives ===== | ===== Learning ojectives ===== | ||
| - | - I can explain | + | - Be able to explain |
| - | - I can name at least three events-types | + | - Be able to name actions that can follow |
| - | - I can apply events | + | - Be able to use simple Vue events. |
| ===== Introduction ===== | ===== Introduction ===== | ||
| - | Events are actions or occurrences that happen | + | After discussing the topic of //vue directives// |
| - | * clicking a button, | + | |
| - | | + | |
| - | | + | |
| - | + | ||
| - | In Vue, events let you respond to these actions | + | |
| - | In Vue.js, events are how we listen | + | Or with other words **event handling** is a key concept in programming that allows applications |
| - | When an event is triggered, Vue runs the method you specify. This makes your components interactive and dynamic. | + | ===== Examples for events ===== |
| + | * Forms: Open, display, input, change, delete, close | ||
| + | * Form input fields: when changed, when touched with mouse pointer, when clicked, when double-clicked, | ||
| + | * Command buttons: when approaching, | ||
| ===== Source ===== | ===== Source ===== | ||
| - | * [[https:// | + | * [[https:// |
| - | + | ||
| - | + | ||
| - | ===== Example 1 ===== | + | |
| - | This example below shows how to use v-on:click to handle a button click. | + | |
| - | + | ||
| - | * @click=" | + | |
| - | * When the button is clicked, the sayHello method is called and the message displayed on the screen. | + | |
| - | + | ||
| - | < | + | |
| - | < | + | |
| - | <button @click=" | + | |
| - | </ | + | |
| - | </ | + | |
| - | + | ||
| - | < | + | |
| - | export default { | + | |
| - | methods: { | + | |
| - | sayHello() { | + | |
| - | alert(' | + | |
| - | } | + | |
| - | } | + | |
| - | } | + | |
| - | </ | + | |
| - | + | ||
| - | + | ||
| ===== Vocabulary ===== | ===== Vocabulary ===== | ||