eslint配置了不允许使用alert,但是有个需求需要用到。 //eslint-disable-next-line alert('测试'); 如上,即可跳过当前行代码检查了 转载于:https://www.cnblogs.com/kugeliu/p/9412065.html