O'Reilly logo

Getting to Know Vue.js: Learn to Build Single Page Applications in Vue from Scratch by Brett Nelson

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

© Brett Nelson 2018
Brett NelsonGetting to Know Vue.jshttps://doi.org/10.1007/978-1-4842-3781-6_8

8. Using Components

Brett Nelson1 
(1)
Eagan, Minnesota, USA
 

It’s not usually a good idea to get all your apps into one JavaScript file. With Vue we can use components to create reusable portions of our app and make it easier to maintain. In this chapter, we will learn how to create and use a custom Vue component, share data with components, use events, and use slots.

What Is a Component ?

You might be wondering what a component is and why you should care. Both those questions are good things to figure out.

A component in the sense that we are going to be exploring is a custom element that we can define and reuse. We will define our components as little ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required