Vue.js ‘$remove’ method

$remove is a handy internal method of Vue.js to remove an element in an array. This method is pretty much just calling the splice() function, but reducing the number of lines of code.

Example: https://jsfiddle.net/jpv056o2/


this.yourArrayName.$remove(elementIndex)

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s