Unterschiede
Hier werden die Unterschiede zwischen zwei Versionen angezeigt.
| Nächste Überarbeitung | Vorhergehende Überarbeitung | ||
| en:modul:m291:learningunits:lu07:aufgaben:01 [2025/04/29 13:00] – angelegt vdemir | en:modul:m291:learningunits:lu07:aufgaben:01 [2025/05/09 09:33] (aktuell) – vdemir | ||
|---|---|---|---|
| Zeile 1: | Zeile 1: | ||
| - | ====== LU07.A01 - Events | + | ====== LU07.A01 - Methods simple |
| ===== Prerequisites | ===== Prerequisites | ||
| Zeile 10: | Zeile 10: | ||
| - Use of Vue Methods. | - Use of Vue Methods. | ||
| - Writing own methods und make use of them. | - Writing own methods und make use of them. | ||
| - | - | + | |
| ===== Source ===== | ===== Source ===== | ||
| * [[https:// | * [[https:// | ||
| Zeile 18: | Zeile 18: | ||
| * 1.2: Transfer the above provided script to this new directory. | * 1.2: Transfer the above provided script to this new directory. | ||
| * 1.3: Make sure that you have the title <h1> correctly named: **lu07.s01.html** | * 1.3: Make sure that you have the title <h1> correctly named: **lu07.s01.html** | ||
| - | * 1.4: Execute the script. As a result, in the right window there will be a green rectangle. After clicking on that green area there should be a message-box with the content **Hello World!** | + | * 1.4: Execute the script. As a result, in the right window there will be a green rectangle. After clicking on that green area there should be a message-box with the content **Hello World** |
| + | |||
| + | ===== Assignment 2: resetText ===== | ||
| + | * 2.1: Add a method **resetText**, | ||
| + | * 2.2: Use this new method // | ||
| + | * 2.3: The text //Hello world// appears, when clicking the first area, and disapears when pushing the second area. | ||
| + | |||
| + | ===== Assignment 3: increment by 1 ===== | ||
| + | * 3.1: Add a new variable //cnt1// and initialize it with 0. | ||
| + | * 3.2: Add a method **increment1**, | ||
| + | * 3.3: Create in the HTML-area a //div//, which increments the // | ||
| - | ===== Assignment | + | ===== Assignment |
| - | * 2.1: Add in a new variable //cnt// and initialize it with 0. | + | * 4.1: Add a new variable //cnt2// and initialize it with 0. |
| - | * 2.2: Add a method **increment**, that increments the //cnt-variable// with step-size | + | * 4.2: Add a method **increment2**, that increments the //cnt2-variable// with step-size |
| - | * 2.3: And finally create | + | * 4.3: Create |
| + | |||
| + | ===== Assignment 5: cascading use of methods | ||
| + | * A5.1: Create a new method **alltogether** which, in turn, uses the methods //setText, increment1, increment2// | ||
| + | * A5.2: Add a variable //text2// to store the combined content of the variables text, cnt1 and cnt2 | ||
| + | * A5.3: Create in the HTML-area a //div//, in which the content of the variable //text2// is displayed | ||
| - | ===== Assignment | + | ===== Assignment |
| - | *A3.1: Add another varible //cnt2// for a second increment-method | + | * A6.1: Define |
| - | *A3.2: Add another | + | * A6.2: Create in the HTML-area a //div//, that resets all variables when clicked. |
| - | *A3.3: Define another div for making use of the method | + | |
| - | ===== Assignment 4: cascading use of methods ===== | ||
| - | * A4.1: Define a final method // | ||
| - | * A4.2: The methods // | ||
| - | * A4.3: Be content and happy, as you finshed the complete assignment. | ||
| ===== Solution ===== | ===== Solution ===== | ||
| Zeile 43: | Zeile 53: | ||
| | rectangle | Rechteck | | | rectangle | Rechteck | | ||
| | content | zufrieden | | | content | zufrieden | | ||
| + | | which, in turn | die ihrersetis | | ||