methods:{
getImg(){
var tips = [
{href:"https://ask.csdn.net/questions/7633263?answer=53670841",imgUrl:"https://ftp.bmp.ovh/imgs/2021/06/18714484ed0bcedd.jpeg"},
{href:"https://ask.csdn.net/questions/7633263?answer=53670841",imgUrl:"https://ftp.bmp.ovh/imgs/2021/06/6c1de67f16cd473a.jpg"},
{href:"https://ask.csdn.net/questions/7633263?answer=53670841",imgUrl:"https://ftp.bmp.ovh/imgs/2021/06/f1e72ea4509bfdc3.jpg"},
{href:"https://ask.csdn.net/questions/7633263?answer=53670841",imgUrl:"https://ftp.bmp.ovh/imgs/2021/06/0e08adcc12a84823.jpg"},
{href:"https://ask.csdn.net/questions/7633263?answer=53670841",imgUrl:"https://ftp.bmp.ovh/imgs/2021/06/c10aede244ea0307.jpg"},
{href:"https://ask.csdn.net/questions/7633263?answer=53670841",imgUrl:"https://ftp.bmp.ovh/imgs/2021/06/6aa6957f01aaf8cf.jpg"},
{href:"https://ask.csdn.net/questions/7633263?answer=53670841",imgUrl:"https://ftp.bmp.ovh/imgs/2021/06/ffafc9b499c87516.jpg"},
{href:"https://ask.csdn.net/questions/7633263?answer=53670841",imgUrl:"https://ftp.bmp.ovh/imgs/2021/06/37f229f7abf99d89.jpg"},
{href:"https://ask.csdn.net/questions/7633263?answer=53670841",imgUrl:"https://ftp.bmp.ovh/imgs/2021/06/8ffaa2489786e6f8.webp"},
{href:"https://ask.csdn.net/questions/7633263?answer=53670841",imgUrl:"https://ftp.bmp.ovh/imgs/2021/06/a4d652910bbb7826.jpg"},
]
var newArr = this.getRandomArrayElements(tips, 5)
for (var i=0;i<newArr.length;i++){
document.write("<a href='"+newArr[i].href+"' target='_Blank'><img src='"+newArr[i].imgUrl+"' style='width:150px;height:150px;'></a>");
},
getRandomArrayElements(arr, count) {
var shuffled = arr.slice(0), i = arr.length, min = i - count, temp, index;
while (i-- > min) {
index = Math.floor((i + 1) * Math.random());
temp = shuffled[index];
shuffled[index] = shuffled[i];
shuffled[i] = temp;
}
return shuffled.slice(min);
}
}