Skip welcome & menu and move to editor
Welcome to JS Bin
Load cached copy from
 
<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width">
  <title>JS Bin</title>
</head>
<body>
<script src="https://cdnjs.cloudflare.com/ajax/libs/vue/1.0.16/vue.js"></script>
<div id="app">
    <div v-for="task in tasks">
            <my-task :task="task"></my-task>
    </div>
    
</div>
<template id="task-template">
    <h1>My tasks</h1>
    <div class="">{{ task.name }}</div>
</template>
</body>
</html>
 
var myTask = Vue.component('my-task',{
  template : '#task-template',
  data : function(){
      return this.tasks
  },
  props : ['task']
});
new Vue({
el : '#app',
data : {
    tasks : [
        { name : "task 1", completed : false},
        { name : "task 2", completed : false},
        { name : "task 3", completed : true}
    ]
},
components: {myTask: myTask},
methods : {
},
computed : {
},
ready : function(){
}
});
Output

You can jump to the latest bin by adding /latest to your URL

Dismiss x
public
Bin info
anonymouspro
0viewers