//生成从minNum到maxNum的随机数
randomNum(minNum, maxNum) {
switch (arguments.length) {
case 1:
return parseInt(Math.random() * minNum + 1, 10);
case 2:
return parseInt(Math.random() * (maxNum - minNum + 1) + minNum, 10);
default:
return 0;
}
},
async initImg() {
console.log('this.randomNum(1, 7)----', this.randomNum(1, 7))
console.log('image----',this.randomNum(1, 7))
let url = '../../static/'+this.randomNum(1, 7)+'.jpg'
console.log('url---',url)
// const image = await import(url)
// console.log('image----111',image)
this.imageURL = url
},