Dies ist eine alte Version des Dokuments!
LU07.A02 - Events - Moose-count
Prerequisites
- Work type: Individual
- Means of aid: only teaching materials, no websearch, no use of ai.
- Timeframe: 25 Minutes
- Expected result: A Vue-Script, which uses methods to display messages on the screen and increments and decrements a counter.
Learning Objectves
- Implementing VUE methods by using arguments.
- Increment and decrement a counter within a method.
- Writing own methods and making use of them.
Source
Assignment A - 2'
- Test the code example above which was provided to you. Describe the behaviour of the script using HTML comments.
- Make sure that everthing is working correctly: The moose-count uses the method addMoose by processing the number we need to count up or down
- increments by 1
- decrements by -1
- increments by +5
- Make sure that you have the title <h1> and have correctly named the file: lu07.s02.html
Assignment B - 5'
- Currently we can increment by +1 and +5, and decrement by -1.
- Similar to addMoose add method removeMoose* which manges the decrement operations and use it. - Test your results and save it. - Add more buttons wich can - increment by +10 - decrement by -10 - decrement by -5 - The aim is to have 3 increment-buttons (+1, +5, +10) and 3 decrement-buttons (-1, -5, -10) ===== Assignment C: Catching numbers belov zero (0) - 7' ===== - It it strikingly obvious, that we can't have e.g. -5 moose, thus negativ numbers are not allowed. Subsequently we must stop counting, when the count reches the zero. - Add the case below zero to your removeMoose-method by checking the count with a if-statement - Check the result: It must stop at zero when the button removeMoose** when the count reaches 0.