Advertisement
Guest User

Untitled

a guest
Jun 19th, 2019
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.57 KB | None | 0 0
  1. <div v-for="task in tasks" :key="task.id" v-if="task.completed">
  2. <ul>
  3. <li v-text="task.description"></li>
  4. <input type="checkbox" @change="changeComplete">
  5. </ul>
  6. </div>
  7.  
  8.  
  9.  
  10.  
  11. var app = new Vue ({
  12. el: '#root',
  13. data: {
  14. tasks: [
  15. {description: 'clean room', completed: true, id: 1},
  16. {description: 'do homework', completed: true, id: 2},
  17. {description: 'go to sleep', completed: false, id: 3}
  18. ]
  19. },
  20. methods: {
  21. changeComplete() {
  22. this.task.completed = !this.task.completed;
  23. }
  24. }
  25. })
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement