April 2017
Intermediate to advanced
454 pages
12h 51m
English
In the previous recipe we built a list for a countdown for a missile launch:
<div id="app"> <ul> <li v-for="n in countdown">{{n}}</li> <li>launch missile!</li> </ul> </div>
new Vue({ el:'#app', data: { countdown: [10,9,8,7,6,5,4,3,2,1] }})
Wouldn't it be great if it was animated? We can tweak the JavaScript to add numbers to countdown as seconds pass:
To get hold of the countdown variable we must pass the variable through the Vue instance itself.
var vm = new Vue({ el:'#app', data: { countdown: ...Read now
Unlock full access