Below is a small Vue script that creates a reactive object, then takes part of its data through ordinary destructuring and prints a computation log. You need to predict the exact program output in stdout and briefly explain it in comments on the marked lines of the file.
What is required
- Do not fix the code.
- Determine the exact order of the lines the program will print.
- Explain in comments why some computations remain reactive while others do not.
- The answer must rely only on the behavior of the existing program.
How to reproduce
- Save the files as shown below.
- Install dependencies.
- Run the program with the command:
npm run start
Expected behavior
- The program deterministically prints several lines to the console.
- In the output, it is important to account for the difference between reading through the original reactive object and reading through ordinary local variables obtained by destructuring.