In this lesson, we will learn how to iterate over an array in a Vue.js template using the
v-for property. We can add to and remove from that list using
Thank you for the introduction.
For better semantics and accessibility I think it's better to always use a
<form> when collecting user input. This way the form shows up in the accessibility tree. By hooking up to the submit event, a new item is added when the button is clicked, or the user presses enter in the input field, or any other way the form could be submitted. Finally, adding a label to an input field helps clarifying what input is expected. So the template would become something like this:
<form v-on:submit.prevent="addItem"> <label for="newItem">New dinosaur</label> <input id="newItem"> <button>Add</button> </form>
Glad I looked at the Discussions. I was wondering the same and I think he rather flies through the material and really I can get this off the Docs. So your next thought would be why don't you then? Why I commit to a Tutorial site is so I can get a better explanation than the Docs usually give. There is no real explanation of anything.