Get the most from each lesson’s live editor with a deliberate loop—the same habits that transfer to Vite, Vue CLI, or Nuxt projects.
Recommended workflow
- Read the concept section before touching code.
- Click Run in browser to compile TypeScript and execute in the preview iframe.
- Use
printOutput(...)to inspect values in the terminal panel below the editor. - When a lesson shows UI, define a component with
setup()+template, then callmountApp(App)— the preview renders inside#app. - Change one idea at a time (one ref, one directive, one prop).
- Read TypeScript errors in the terminal—they often point to wrong prop types before runtime.
- Reset the editor if you drift too far from the lesson goal.
What happens when you Run
- Your TypeScript runs in the browser (same idea as a dev server without the file system).
- Vue 3 loads from CDN with the global build and template compiler.
Vueis a global—destructure APIs:const { ref, computed } = Vue;mountAppcallscreateApp(component).mount('#app')in the iframe.
Review TypeScript intro if type errors block you. If you know React, compare setup() return values to what you expose from a function component.
Self-check
- What is the difference between
printOutputandmountApp? - Why change one concept at a time while learning?
Challenge
First run
- Click Run in browser with the default code.
- Confirm
typeof Vueprintsobjectin the terminal. - Add a second
printOutputwith your name.
Done when: the terminal shows Vue types and your custom message.