O'Reilly logo

The Majesty of Vue.js by Kostas Maniatis, Alex Kyriakidis

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

Chapter 9. Working with Real Data

It is time to actually put in use our database and perform the operations we have mentioned (CRUD). We will utilize the Altogether now example from Chapter 6, Components, but this time, of course, our data will come from an external source. To exchange data with the server we need to perform asynchronous HTTP (Ajax) requests.

Note

AJAX is a technique that allows web pages to be updated asynchronously by exchanging small amounts of data with the server behind the scenes.

Geting data asynchronously

Take a moment to have a look at the the Altogether now example from Chapter 6, Components. As you can see, we hardcode the stories array inside the data object of Vue instance.

The stories array hardcoded:

new Vue({ data: { ...

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