请问我这个,不报错,也不显示,是哪的问题,vue版本1.0.28
<div class="container" id="app">
<task-app></task-app>
</div>
<template id="task-template">
<ul>
<li
@click="toggleTasks(task)"
:class="{'completed':task.completed}"
v-for="task in tasks"
>
{task.body}
</li>
</ul>
</template>
<script>
Vue.component('task-app',{
template:'#task-template'
});
new Vue({
el:'#app',
data:{
tasks:[
{body:'1211111',completed:false},
{body:'2222222',completed:true},
{body:'3333333',completed:false}
]
},
methods : {
toggleTasks : function(task) {
task.completed = ! task.completed;
}
}
})
</script>