November 2017
Beginner to intermediate
398 pages
8h 42m
English
This second feature is a bit more complicated because we need a new method:
<button @click="removeNote" title="Remove note"><i class="material-icons">delete</i></button>
As you can see, we listen to the click event with the v-on shorthand (the @ character) that calls the removeNote method that we will create very soon. Also, we put an appropriate icon as the button content.
removeNote () { if (this.selectedNote && confirm('Delete the note?')) { // Remove the note in the notes array const index = this.notes.indexOf(this.selectedNote) ...Read now
Unlock full access