Students make a Vue app, predict that the page follows the data with no textContent, match the parts of the app, find a plain variable Vue does not watch, add a button and new data, and make a two-value counter. About 50 minutes.
I can explain why the page changes by itself when the data changes.
Before class
Read the unit primer first. A Vue app has two halves. The page is ordinary HTML inside <div id="app">, with {{ name }} wherever a value should appear. The setup function makes the data with ref(...) and returns the names the page may use. createApp({ setup() { … } }).mount("#app") joins them. When a ref changes, Vue redraws the parts of the page that show it: students never write textContent.
vue.js sits beside the page in the playground (it is served from this site). On a real site you would use Vue's file from vuejs.org or a build tool; teacher notes later in the course say more. The console shows one line about a development build: that is the version with friendlier warnings, chosen on purpose.
@click="score++" is a recipe in this lesson (events are lesson 3). The planted bug is a plain let variable: the click changes it but Vue is not watching, so the page never updates and there is no error. That is the most important idea in the course: Vue only keeps up with data it watches.
Running the lesson
Predict: ask students who did the DOM course which line they expect to need.
Run: change the title in setup and run again; nothing else on the page needs to change.
Investigate: for the bug, ask "how does Vue know the score changed?"
Modify: new data is three edits: the ref, the return, the {{ }}. Write them as a checklist on the board.
Make: ask each student which button changes which ref.
The hard part (on purpose)
Students forget one of the three edits (ref, return, {{ }}) and the value does not show. Ask them to point to all three for each piece of data before you look at the code.
When students get stuck
The page shows {{ score }} as text. Ask: Is the vue.js line there, and does the app mount on #app? Fix: Load vue.js before the script, and keep the {{ }} inside the div with id app.
A value is blank and the console warns it was accessed but is not defined. Ask: Is its name in the return? Fix: Add it: return { title, score, team };
Clicks do nothing and there is no error. Ask: Was the data made with ref? Fix: const score = ref(0); a plain let is not watched.
Stretch and support
Stretch: Show the score twice on the page (in the title and a paragraph) and watch both follow. Add a button that doubles the score.
Support: Give the finished run page and ask students only to add the Take a point button.
Where it leads
Next lesson: lists with v-for and choices with v-if. Class idea: list three apps and name the data each one keeps.
Predict: Students who learned textContent expect the page to stay at 0; seeing it follow the data is the whole idea of Vue.
Investigate: createApp looks after everything inside #app; ref makes data Vue watches; setup returns the names the page can use; {{ }} shows them and keeps them up to date.
Modify: New data is a ref returned from setup; the page can show it anywhere with {{ }}.
a counter of your own: Goals only: two refs, shown with {{ }}, each changed by a button.