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
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.