Vue.js for Beginners

Build interactive web pages with Vue 3 and the Composition API: templates, directives, reactivity, components, forms and data, all in your browser.

  • 0 students
  • 88 lessons
  • 6 h 36 min

Created by Ayim Nelson

What you will learn

  • Explain what Vue does and start an app with createApp and setup()
  • Write templates with interpolation and the v-bind, v-on, v-if, v-show, v-for and v-model directives
  • Keep data reactive with ref, reactive, computed, watch and watchEffect
  • Build forms with v-model and simple validation
  • Split a page into components that talk through props, emits and slots
  • Load data when a component mounts, with loading and error states
  • Share data across components with provide/inject and composables
  • Set up a real project with Vite, single-file components, script setup, Pinia and Vue Router

About this course

Vue is a friendly, popular framework for building interactive websites. In this course you learn Vue 3 with the Composition API by building a price board for Maame Serwaa's vegetable stall at Kejetia Market, Kumasi, one short lesson at a time: templates and directives, refs, computed values and watchers, lists, forms, components with props, events and slots, loading data, and provide and inject. Every lesson's code runs right here in your browser, with nothing to install.

For: anyone who has finished the JavaScript Crash Course or already knows the basics of JavaScript: variables, functions, arrays, objects, arrow functions and array methods like map() and filter(). A little HTML and CSS helps too.

By the end: you'll have built a working price board where customers see today's prices loaded from a server, filter them, fill a basket and place an order through a checked form, and you'll know how a real Vue project is set up with Vite, single-file components, Pinia and Vue Router.

Course content

11 sections · 88 lessons

Meet Vue7 lessons
Templates7 lessons
  • Text interpolationReading · 3 min
  • Expressions in templatesReading · 3 min
  • Binding attributes with v-bindReading · 3 min
  • The : shorthandReading · 2 min
  • Binding classesReading · 3 min
  • Binding inline stylesReading · 3 min
  • The price tagExercise · 10 min
Events and ref9 lessons
  • Listening for a click with v-onReading · 3 min
  • Why a plain variable doesn't updateReading · 3 min
  • ref() makes a value reactiveReading · 4 min
  • Handler functionsReading · 3 min
  • Passing an argumentReading · 3 min
  • The event objectReading · 3 min
  • Event modifiersReading · 3 min
  • Key modifiersReading · 3 min
  • The customer counterExercise · 10 min
More reactivity7 lessons
  • reactive() for objectsReading · 4 min
  • Don't destructure a reactive objectReading · 3 min
  • computed()Reading · 4 min
  • computed or a function?Reading · 3 min
  • watch()Reading · 4 min
  • watchEffect()Reading · 3 min
  • The basket calculatorExercise · 12 min
Conditions and lists10 lessons
  • v-ifReading · 3 min
  • v-else-if and v-elseReading · 3 min
  • v-showReading · 3 min
  • v-if or v-show?Reading · 2 min
  • Rendering a list with v-forReading · 4 min
  • Why v-for needs a :keyReading · 3 min
  • The index in v-forReading · 3 min
  • Filtering with computedReading · 3 min
  • Changing an arrayReading · 3 min
  • The full price boardExercise · 12 min
Forms and v-model9 lessons
  • v-model on a text boxReading · 3 min
  • .number and .trimReading · 3 min
  • Select menusReading · 3 min
  • A single checkboxReading · 2 min
  • Several checkboxesReading · 3 min
  • Radio buttonsReading · 2 min
  • Submitting a formReading · 3 min
  • Simple validationReading · 3 min
  • The order formExercise · 15 min
Components and props8 lessons
  • What a component isReading · 3 min
  • Defining a componentReading · 3 min
  • Using a componentReading · 3 min
  • Passing propsReading · 4 min
  • Prop types and defaultsReading · 3 min
  • Props are read-onlyReading · 3 min
  • Components in a v-forReading · 3 min
  • Price cardsExercise · 12 min
Events from components and slots7 lessons
  • Emitting an eventReading · 4 min
  • Sending a value with an eventReading · 3 min
  • Declaring emitsReading · 2 min
  • v-model on a componentReading · 4 min
  • SlotsReading · 3 min
  • Named slotsReading · 3 min
  • The basketExercise · 15 min
Lifecycle and loading data9 lessons
  • onMountedReading · 3 min
  • onUnmounted and cleaning upReading · 4 min
  • Template refsReading · 3 min
  • Why the lessons fake the serverReading · 3 min
  • A fake fetchReading · 4 min
  • Loading data in onMountedReading · 4 min
  • Loading and error statesReading · 4 min
  • What real fetch code looks likeReading · 3 min
  • Load today's pricesExercise · 15 min
Sharing state6 lessons
  • Prop drillingReading · 3 min
  • provide and injectReading · 4 min
  • Providing a refReading · 4 min
  • ComposablesReading · 4 min
  • Pinia: a store for the whole appReading · 4 min
  • Retail or wholesaleExercise · 12 min
Real projects with Vite9 lessons
  • Creating a project with ViteReading · 4 min
  • Inside the projectReading · 3 min
  • Single-File ComponentsReading · 4 min
  • script setupReading · 4 min
  • defineProps and defineEmitsReading · 3 min
  • Vue Router: pagesReading · 4 min
  • Building for productionReading · 3 min
  • Maame Serwaa's price boardExercise · 20 min
  • Final quizQuiz · 10 min

Reviews

No reviews yet.

Comments

Log in to join the conversation.

Loading comments...