====== LU05.A12 - v-if, v-else ... combined with AND/OR operators ====== ===== Prerequisites ===== * Work type: Individual * Means of aid: only teaching materials, no websearch, no use of ai. * Timeframe: 20 Minutes * Expected result: A Vue script that displays HTML elements based on input values. ===== Learning objectives ===== - Explaining the The directive //v-if// in your own word. - Being able to apply v-if in combination with AND/OR operators ===== Source ===== * [[https://www.w3schools.com/vue/tryit.php?filename=tryvue_v-if_typewriters3 |Code-example]] ===== Assignment ====== This assignment combines if with the using of AND/OR operators. That means that several rules must be obeyed in the if-clause. - Change the value within the if to //<12// for people under the age of 12 are allowed to go to the cinema. - Execute your script - Between 12 and 16 they are allowed up to 18 o'clock. - Execute your script - Person older than 16 may go to the cinemas without time restriction. - Execute your script - Comment and save your script your results accordingly. - Change your script for young customers may also go to the cinema when they are accompanied by an adult. Therefore will need a additionel variable //withAdult// which must be checked within the selection area by combining the existing restrictions with an AND/OR operator. - Execute your script - Comment and save your script your results accordingly. ===== Solution ===== [[en:modul:m291:learningunits:lu05:loesungen:12|Lösung]] ===== Vocabulary ===== ^ English ^ German ^ | afterwards | anschliessend| | accordingly | entsprechend | ---- [[https://creativecommons.org/licenses/by-nc-sa/4.0/|{{https://i.creativecommons.org/l/by-nc-sa/4.0/88x31.png}}]] Volkan Demir