直接return false没用,需要用throw来跳出foreach

 1       try {
 2         this.categoryList.forEach((item, index) => {
 3           if (item.title !== '') {
 4             data = {
 5               page: item.xxx,
 6               state: item.xxx,
 7             }
 8             throw new Error('')
 9           }
10         })
11       } catch (e) {
12         this.getList(data)
13         return false
14       }

 

相关文章:

  • 2021-11-23
  • 2021-05-15
  • 2021-11-23
  • 2021-12-12
  • 2021-11-23
  • 2022-12-23
  • 2021-11-23
猜你喜欢
  • 2021-12-02
  • 2022-12-23
  • 2022-12-23
  • 2021-12-02
  • 2021-12-02
  • 2021-12-02
  • 2021-12-02
相关资源
相似解决方案