From the course: Learning Vue.js

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Creating single file components

Creating single file components - Vue.js Tutorial

From the course: Learning Vue.js

Start my 1-month free trial

Creating single file components

- [Instructor] Now we'll create our own simple component and add it to this page. Back in our single file component named app, let's take a closer look at what's going on here. This components option here is just another way to register components. Previously, we were using the component method to globally register them, making view aware of them so that they could be used anywhere in the app. Using the components option is a way to locally register components as child components of the app component. Let's go ahead and remove all references to this hello world component and then we'll create a new component for our deck name. So in the components folder, I'm going to add a new file decname.view and now we'll create a single file component from scratch. Most single file components have a template element, a script element and a style element. The script element will be used for defining our options object and then…

Contents