Unterschiede

Hier werden die Unterschiede zwischen zwei Versionen angezeigt.

Link zu dieser Vergleichsansicht

Beide Seiten der vorigen Revision Vorhergehende Überarbeitung
Nächste Überarbeitung
Vorhergehende Überarbeitung
en:modul:m291:learningunits:lu07:start [2025/04/29 12:26] vdemiren:modul:m291:learningunits:lu07:start [2025/05/05 13:28] (aktuell) vdemir
Zeile 1: Zeile 1:
-====== LU07a VUE Events ======+====== LU07 Methods ======
  
-===== Learning ojectives ===== +===== Theory =====
-  - I can explain what //events// basically are.  +
-  - I can name at least three events-types +
-  - I can apply events within the VUE framework+
  
 +<nspages .:theorie -h1  -exclude:start -simpleList -textPages="">
  
-===== Introduction ===== +===== Assignments =====
-Events are actions or occurrences that happen in the browser—like a user  +
-  * clicking a button,  +
-  * typing into a field, or  +
-  * moving the mouse.  +
-  +
-In Vue, events let you respond to these actions by running specific methods when they occur. You can listen for events using the v-on directive or its shorthand @. This is how Vue apps become interactive, reacting to user input and behavior in real time.+
  
-In Vue.js, events are how we listen to user interactions and respond to them—things like clicks, keypresses, mouse movements, and more. Vue uses the v-on directive (or the shorthand @) to attach event listeners to HTML elements.+<nspages .:aufgaben -h1  -exclude:start -simpleList -textPages="">
  
-When an event is triggered, Vue runs the method you specify. This makes your components interactive and dynamic.+===== Solutions =====
  
-===== Source ===== +<nspages .:loesungen -h1  -exclude:start -simpleList -textPages="">
-  * [[https://www.w3schools.com/vue/vue_events.php| W3School-Events]] +
- +
- +
-===== Example 1 ===== +
-This example below shows how to use v-on:click to handle a button click.  +
- +
-  * @click="sayHello" listens for a click event. +
-  * When the button is clicked, the sayHello method is called and the message displayed on the screen. +
- +
-  <template> +
-    <div> +
-      <button @click="sayHello">Click Me, please!</button> +
-    </div> +
-  </template> +
-  <script> +
-    export default { +
-      methods: { +
-        sayHello() { +
-          alert('Hello World, it's me VUE!'); +
-        } +
-      } +
-    } +
-  </script> +
-   +
-===== Example 2 ===== +
-Here's how you can capture input from a user and update data in real-time: +
- +
-  * @input="updateNamelistens for input changes. +
-  * The updateName method grabs the input value and updates the name data. +
-  * The UI updates reactively with { { name } }. +
- +
- +
-  <template> +
-    <div> +
-      <input @input="updateName" placeholder="Enter your name" /> +
-      <p>Hello, {{ name }}!</p> +
-    </div> +
-  </template> +
-  <script> +
-    export default { +
-      data() { +
-        return { +
-          name: '' +
-        }; +
-      }, +
-    methods: { +
-      updateName(event) { +
-        this.name = event.target.value; +
-      } +
-    }  +
-  } +
-  </script> +
- +
- +
- +
- +
-===== Vocabulary ===== +
-^ English ^ German ^  +
-| ... | ... |+
  
 ---- ----
 [[https://creativecommons.org/licenses/by-nc-sa/4.0/|{{https://i.creativecommons.org/l/by-nc-sa/4.0/88x31.png}}]] Volkan Demir [[https://creativecommons.org/licenses/by-nc-sa/4.0/|{{https://i.creativecommons.org/l/by-nc-sa/4.0/88x31.png}}]] Volkan Demir
  
  • en/modul/m291/learningunits/lu07/start.1745922370.txt.gz
  • Zuletzt geändert: 2025/04/29 12:26
  • von vdemir