随机数

This commit is contained in:
shijingjing
2023-03-21 13:55:25 +08:00
parent 6118aa6b54
commit 807faa4229

View File

@@ -43,8 +43,8 @@ export default {
}
}).then(res=> {
if(res?.data) {
let nums = res.data.records.length
let index = Math.random() * nums.length
let nums = res.data.records
let index = Math.floor(Math.random() * nums.length)
this.picUrl = nums[index].picUrl
}
})