From the course: Vue.js 2 Essential Training

Unlock the full course today

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

Reorganizing hierarchy

Reorganizing hierarchy

From the course: Vue.js 2 Essential Training

Start my 1-month free trial

Reorganizing hierarchy

- In this chapter, I'm going to give you an introduction to using the Vue Router. The Vue Router allows you to create something equivalent to pages on your application. And you can have different pages show different pieces of content. Now, in order to show you how this works, I'm going to need to reorganize the way that I have done my components. So right now I have this main app, that vue file. And it's loading up several components. So I'm loading up navbar, the price-slider, and the product-list. What I eventually want to do is add a checkout page. And that's going to be sort of a separate page in this application. Which means that I want to move everything that is in here into a sub-component of sorts. So, it's just a little bit of a reorganization. We're going to start by creating a new file here. And I'm going to call this one Products.vue. And this is going to be a pretty standard component. So, we're going to start with a template and in here I'm going to start with a…

Contents