Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <div v-for="task in tasks" :key="task.id" v-if="task.completed">
- <ul>
- <li v-text="task.description"></li>
- <input type="checkbox" @change="changeComplete">
- </ul>
- </div>
- var app = new Vue ({
- el: '#root',
- data: {
- tasks: [
- {description: 'clean room', completed: true, id: 1},
- {description: 'do homework', completed: true, id: 2},
- {description: 'go to sleep', completed: false, id: 3}
- ]
- },
- methods: {
- changeComplete() {
- this.task.completed = !this.task.completed;
- }
- }
- })
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement