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:16 [2025/03/27 14:09] – [Assignment 2] vdemiren:modul:m291:learningunits:lu05:aufgaben:16 [2025/03/28 12:02] (aktuell) vdemir
Zeile 9: Zeile 9:
 ===== Learning objectives ===== ===== Learning objectives =====
   - Be able to explain the objective of v-for   - Be able to explain the objective of v-for
-  - Displying the ndex and corresponding array entry using v-for. +  - Display the index and corresponding array entry using v-for. 
-  - Dispalying array elements and the corresponding images with v-for.+  - Display array elements and the corresponding images with v-for.
  
 ===== Source ===== ===== Source =====
Zeile 16: Zeile 16:
  
 ===== Assignment 1 ====== ===== Assignment 1 ======
-It can happen, that we need not only to display the images of our products, but want also to provide additional information to them. That invariably leeds to having to have handle two or more arrays in our source code. +It can happen, that we need not only to display the images of our products, but want also to provide additional information to them. That invariably leads to having to have handle two or more arrays in our source code. 
  
-  - Go to the link to the task mentioned in the source and save it with the appropriate name in your W3School workspace. +  - Click on the link above with the source and save it with the appropriate name in your W3School workspace. 
-  - Change the first x to z and observe what happens.  +  - Change within the **v-for** the **x** to **z**.  
-  - Execute your script --> The images will will disappear. +  - Execute your script  --> The images will will disappear. Why? 
-  - Than change the second x to a z --> The images will appear again. +  - Then change **x** within the //<figcaption>// and the //<img>// from **x** to a **z** as well --> The images will appear again. Why? 
-  - Note downfor what the first respectively the second usage of x stands for. +  - Note down for what the first respectively the second usage of **x/z** stands for. 
  
 ===== Assignment 2 ===== ===== Assignment 2 =====
-It can happen, that besides the image, we also want to display the description of our products on our website. That means, that it is time for some elbow grease. We want to handle a multi-dimensional array. Have fun with the challenge. For more information consult the following link[[https://www.w3schools.com/vue/tryit.php?filename=tryvue_v-for_foodImgs2| multi-dimensional arrays]]+It can happen, that besides the image, we also want to display the description of our products on our website. Thus we want to handle a //multi-dimensional array//
  
-  - As we just changed the dimension of our array, we need to adjust the call in the v-for-part from z to z.img. +  - Add a column **comm**-column with comments to your food-list (array) in the script part 
-  - Execute your script. If everything was done properly you will see the content as before.  +    * If you like it: **OK**.  
-  - Add a comment-column to you food-list (array). If you like it: **OK**. If not: **NOK** +    * If not: **NOK** 
-  - Add a <div>-tag just after the <img> tag for the **v-if** +  - Display the comm-entries after the name of the dish by using **z.comm** 
-    - The output is in the case of **OK**: <color #ed1c24>I like ... </color> +  - Execute your script. If everything was done properly you will see the images as before AND the comment below the images. 
-    - close the div +  - Comment your script accordingly an save it.
-  - Execute your script. If everything was done properly you will receive a message what you like, in red letters. +
-  - Add a second <div> for the **v-else** +
-    - The output is in the case of **OK**: <color #22b14c>I don't like  </color> +
-    - close the div +
-  - Execute your script. If everything was done properly you will receive a message what you don't like, in green letters.+
    
- 
- 
-x 
-  - Execute your script. If everthing was done properly you will see the images as before AND the comment below the image. 
-  - Do the same with the names of the dishes. 
-  - Execute your script. If everthing was done properly you will see the images as before, the status, but now also the names of the dishes.  
-  - Comment you script accordingly an save it. 
- 
-**Hint:** Multidimensional arrays are manages as follows:  
-  manyBeaches: [{name: 'Sunset', url: './public/beach1.jpg', stat: 'Nice'}, ... ] 
-  
- 
 ===== Solution ===== ===== Solution =====
 [[en:modul:m291:learningunits:lu05:loesungen:16|Lösung]] [[en:modul:m291:learningunits:lu05:loesungen:16|Lösung]]
- 
  
  
  • en/modul/m291/learningunits/lu05/aufgaben/16.1743080997.txt.gz
  • Zuletzt geändert: 2025/03/27 14:09
  • von vdemir