Unterschiede
Hier werden die Unterschiede zwischen zwei Versionen angezeigt.
Beide Seiten der vorigen Revision Vorhergehende Überarbeitung Nächste Überarbeitung | Vorhergehende Überarbeitung | ||
en:modul:m291:learningunits:lu05:aufgaben:16 [2025/03/27 10:49] – vdemir | en: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 | + | - Display |
- | - Dispalying | + | - Display |
===== 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 | + | 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 |
- | - 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 |
- | - Execute your script. | + | - Execute your script |
- | - Than change the second | + | - Then change |
- | - Note down, for 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. | + | It can happen, that besides the image, we also want to display the description of our products on our website. |
- | + | ||
- | - E.g.: Multidimensional arrays are manages as follows: **manyBeaches: | + | |
- | - Name the already existing entries: **img** | + | |
- | - 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 < | + | |
- | - Execute your script. If everthing was done properly you will see the images as before. | + | |
- | - Now add a comment-column to you food-list (array). If you like it: **OK**. If not: **NOK** | + | |
- | - Display the comment with a figcaption-tag by using **z.comm** within a double bracket **{{}}**. | + | |
- | - 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. | + | |
+ | - Add a column **comm**-column with comments to your food-list (array) in the script part. | ||
+ | * If you like it: **OK**. | ||
+ | * If not: **NOK** | ||
+ | - Display the comm-entries after the name of the dish by using **z.comm** | ||
+ | - Execute your script. If everything was done properly you will see the images as before AND the comment below the images. | ||
+ | - Comment your script accordingly an save it. | ||
- | |||
===== Solution ===== | ===== Solution ===== | ||
[[en: | [[en: | ||
- | |||