vue.in.oxygen.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
document.addEventListener('DOMContentLoaded', function(event) { | |
var myApp = new Vue({ | |
el: '#app', | |
vuetify: new Vuetify(), | |
data: { | |
tasks: [], | |
newTask: null | |
}, | |
methods: { | |
create: function(event) { | |
this.tasks.push({ | |
done: false, | |
text: this.newTask | |
}); | |
this.newTask = null; | |
} | |
}, | |
computed: { | |
completedTasks() { | |
return this.tasks.filter(task => task.done).length; | |
}, | |
progress() { | |
return this.completedTasks / this.tasks.length * 100; | |
}, | |
remainingTasks() { | |
return this.tasks.length - this.completedTasks; | |
} | |
} | |
}) | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment