How to put the object {00: {. }, 01: {. . }, 03: {. . }, 04: {. . }, 05: {. . }} is assigned to the array, and the loop is {. No, no, no. } .

if I assign it directly to the array, [] = {}, when sorting, it jumps to 10, and 10 jumps to the first place

.

clipboard.png


clipboard.png

Feb.27,2021

you want to take the key value, the cyclic key as the serial number, don't you? Object you can use for..in, to store the key value in a new array, and the new array value is the key, loop array. But note that if the key is directly 00, not'00', the loop will lose the previous 0, and this can be dealt with


let arr=[];
for(index in hour_report){
    arr[parseInt(index)]=hour_report[index]
}

then use arr to v-for

Menu