I am learning Vue.JS and I'm creating a simple todo app, where each list has a unique id. I am iterating through all of the list to create a Vue instance:
<div id="todo-list-1" class="todo-list">...</div>
<div id="todo-list-2" class="todo-list">...</div>
<div id="todo-list-3" class="todo-list">...</div>
// main.js
document.querySelectorAll('.todo-list').forEach(list => {
new Vue({
el: `#${list.id}`,
render: h => h(App)
})
})
I want to create a "completed" state, which would be true when all items in a list are completed. So #todo-list-1 has a completed state, same with #todo-list-2 and #todo-list-3.
What would be a good approach to this problem? how can I handle the state for individual vue instances?