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

Reusability

Let's take a look again at our Filtered results example from Chapter 4, List Rendering. Assume this time we take the stories variable data from an external API through an HTTP call. The API developers decide to rename plot story property to body. So now, we have to go through our code and make the necessary changes.

Note

Later in this book we will cover how we can use Vue to make web requests.

<div class="container"> <h1>Lets hear some stories!</h1> <div> <h3>Alex's stories</h3> <ul class="list-group">          <li v-for="story in stories | filterBy 'Alex' in 'writer'"             class="list-group-item"          >             {{ story.writer }} said "{{ story.plot }}"             {{ story.writer }} said "{{ story.body }}"          </li> ...

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