//加try 利用 throw 解决;
try {
turntable.map((item: any, index: number) => {
if (item.count > 100) {
message.warn('抽奖概率应小于100%');
throw 'Custom Exception'
return;
}
});
} catch (e){
console.log(e)
}
map、forEach跳出循环的方法
最新推荐文章于 2024-01-19 16:24:17 发布