Skip to content

Instantly share code, notes, and snippets.

@Spellhammer
Created August 5, 2021 19:14
Show Gist options
  • Save Spellhammer/55c67235fa7f5a7234f6ed4d90858c89 to your computer and use it in GitHub Desktop.
Save Spellhammer/55c67235fa7f5a7234f6ed4d90858c89 to your computer and use it in GitHub Desktop.
vue.in.oxygen.js
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