08.02.2017 Views

vuejs

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Working with real data 106<br />

Upvote stories<br />

9.4 Delete Data<br />

Now let us proceed to another piece of functionality our stories list should have, deleting a story<br />

we don’t like. To remove a story from the array and the DOM, we are going to use Vue’s $remove()<br />

method, which searches for an item and removes it from target Array.<br />

Info<br />

$remove() method works as follows. When you want to remove an item from an array<br />

called items you can do:<br />

vm.items.$remove(item)

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!