随机数
This commit is contained in:
@@ -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
|
||||
}
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user