I want to access the inner <input> element after it has been created by Vue:
<li v-repeat="subtask: subtasks"> <input v-model="subtask.name" type="text"> </li> However, this code does not work:
/* add a new item (that in turn will create a new DOM node) */ subtasks.push({ name: 'wash the dishes', id: 'box-123' }); /* ... Around now, Vue should get busy creating the new <li> ... */ /* Now the element should exist, but it doesn't */ console.log(document.getElementById('box-123')); // --> null However, the getElementById call comes back empty handed--the node does not exist at that time.
When can I be sure Vue has created / updated the DOM?