vue.js array operations

Create an array
Here Insert Picture Description
dynamically add data

Adding data in the array
Here Insert Picture Description
to append data to the end of the array
Here Insert Picture Description

Dynamic data deleted
index values start to delete incoming data in the specified array 1 represents the position of the current incoming value.
If the incoming data 2 saves the current incoming data in the array matches the next data also deleted deleted
this.addresource.splice (this.addresource.indexOf (data), 1 );
Here Insert Picture Description
renderings: 1 Incoming
Here Insert Picture Description
Here Insert Picture Description

Renderings: Incoming 2

Here Insert Picture Description

Guess you like

Origin blog.csdn.net/qq_35226176/article/details/90110664