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

Altogether now

Using our newly acquired knowledge we should be able to build something a bit more complex. Taking the structure example from the preceding example, we are going to create a voting system for our stories, and add a favorite feature. The way to accomplish this, is through methods, directives, and of course, Components.

Lets start with the stories setup:

<html> <head> <link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" rel="stylesheet"> <title>Hello Vue</title> </head> <body> <div id="app"> <div class="container"> <h1>Let's hear some stories!</h1> <ul class="list-group">          <story v-for="story in stories" :story="story"></story>       </ul>       <pre>{{ $data | json }}</pre>    </div> </div> <template ...

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