Vue array operation, how to assign one array to another array?

1. The data area definition variables are as follows:

        all:[],
        current:[],       

2. The server returns 10 pieces of json data and assigns values to the all array. There is no problem here: this.all=response.data;
wants to assign the first five pieces of data of the all array to the current array. Try to use the for loop this.current [I] = this.all [I]. No, how should the value be assigned?

Mar.02,2021

this.current = this.all.slice(0,5)

it's not impossible to assign values in parentheses in Vue, but after assignment, updated, is not triggered, that is, the view is not updated.

you can change the array with methods such as push, pop, or point the pointer directly to a new array, such as the new array returned by slice,filter,map, etc., which will also trigger the view update.

can also change the value of the array by Vue.$set ().

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b314ed-2bd9d.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b314ed-2bd9d.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?