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/21 16:05] – vdemir | en:modul:m291:learningunits:lu05:aufgaben:16 [2025/03/28 12:02] (aktuell) – vdemir | ||
---|---|---|---|
Zeile 1: | Zeile 1: | ||
- | ====== LU05.A16 - v-for list rendering | + | ====== LU05.A16 - v-for list with 2-dimensional arrays |
===== 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: | + | * Timeframe: |
- | * Expected result: A Vue script that uses he v-for directive | + | * Expected result: A Vue script that uses the v-for directive |
===== 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 ===== | ||
- | * [[https:// | + | [[https:// |
- | + | ||
- | ===== Assignment ====== | + | |
- | 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. | + | |
- | + | ||
- | - Go to the link to the task mentioned in the source and save it with the appropriate name in your W3School workspace. | + | |
- | - Add a second array called **comments** with the status of each food: | + | |
- | *you like it: **OK** | + | |
- | *you don't like it: **NOK** | + | |
- | - Display the new status to each food within the v-for directive | + | |
+ | ===== 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 leads to having to have handle two or more arrays in our source code. | ||
+ | - Click on the link above with the source and save it with the appropriate name in your W3School workspace. | ||
+ | - Change within the **v-for** the **x** to **z**. | ||
+ | - Execute your script | ||
+ | - Then change **x** within the //< | ||
+ | - Note down for what the first respectively the second usage of **x/z** stands for. | ||
+ | ===== Assignment 2 ===== | ||
+ | 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 // | ||
+ | - 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: |
===== Vocabulary ===== | ===== Vocabulary ===== | ||
^ English ^ German ^ | ^ English ^ German ^ | ||
- | | bulb | Glühbirne | + | | ... | ... | |