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:lu05:aufgaben:08 [2025/03/04 11:16] vdemiren:modul:m291:learningunits:lu05:aufgaben:08 [2025/03/18 07:46] (aktuell) vdemir
Zeile 1: Zeile 1:
-====== LU05.A07 - v-if (simple) ======+====== LU05.A08 - v-if with numbers instead of bool ======
  
 ===== Prerequisites  ===== ===== Prerequisites  =====
   * Work type: Individual   * Work type: Individual
   * Means of aid: only teaching materials, no websearch, no use of ai.   * Means of aid: only teaching materials, no websearch, no use of ai.
-  * Timeframe: Minutes +  * Timeframe: 10 Minutes 
-  * Expected result: Vue script that displays HTML elements based on input values. +  * Expected result: Vue script that displays HTML elements based on input values.
- +
  
 ===== Learning objectives ===== ===== Learning objectives =====
   - Explaining the The directive //v-if// in your own word.     - Explaining the The directive //v-if// in your own word.  
-  - Manipulating simple DOM elements based on the directive //v-if//+  - Being able to apply logical operators within a v-if directive.  
  
 ===== Source ===== ===== Source =====
-  * [[https://www.w3schools.com/vue/tryit.php?filename=tryvue_v-if_typewriters |Code-example: v-if directive src]]+  * [[https://www.w3schools.com/vue/tryit.php?filename=tryvue_v-if_typewriters2 |Code-example: v-if directive src]]
  
-===== Assignment ====== +===== Assignment ====== 
-In the script area of the W3-School example (link above) you will find a variable //typewritersInStock// with the value //true//In the html area of the same script there will be decidedwhat is supposed to happen in which caseIn the //true-case// there are typewriters on stock, and in the else-case (v-else) they are not+The first assignment checked by using v-if whether certain variable was checked or not (true/false9Bei der ersten Aufgabe hat v-if binären Werte (true/false) geprüftNowwe want to go one step further and check not only whether it is true or false, but moreover which value it containsBy this, we would be able to tell the customer of how many typewriters we have in stock, which may be of some benefit for the customer as well as for us.
  
- +  - Change the value of the variable //typewriter// to and execute the script.  
-  - Change the value of the variable //onStock// to //false// and run the script.  +  - Note your realisations as a html-comment. 
-  - Note your realisations as a html-commen?+  - Change the content of the variable //typeWriter// to -1.  
 +  - What happens, if the value //typeWiter// has no value at all respectively is empty? 
 +  - Note your realisations as a html-comment.
   - Save your script acoordingly, whether in your W3School workspace or on you local computer in your code-editor Webstorm.   - Save your script acoordingly, whether in your W3School workspace or on you local computer in your code-editor Webstorm.
  
  
 ===== Solution ===== ===== Solution =====
-[[en:modul:m291:learningunits:lu05:loesungen:03|Lösung]]+[[en:modul:m291:learningunits:lu05:loesungen:08|Lösung]]
  
-===== Assignment B: local src ===== 
-  - Download another picture of your choice.  
-  - Create in your W3 workingspace a directory //media// and save the downloaded picture there 
-  - overwrite the url in the app to display your new local picture 
-  - Execute your script by having it //run//. 
-  - Save your solution accordingly. Therefore you might need a W3-School-Account.  
- 
-===== Solution ===== 
-[[en:modul:m291:learningunits:lu05:loesungen:08|Lösung]] 
  
 ===== Vocabulary ===== ===== Vocabulary =====
  • en/modul/m291/learningunits/lu05/aufgaben/08.1741083396.txt.gz
  • Zuletzt geändert: 2025/03/04 11:16
  • von vdemir