randomArray(array)
This function can shuffle the order of one-dimensional array elements, which is a random process
array
<Array> One-dimensional array
export default{
data() {
return {
array: [1,2,3,4,5]
}
},
onLoad() {
console.log(uni.$u.randomArray(this.array));
}
}