- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我用的是SAPUI5开发的WebIde。
如果我写一个 console.log
或 alert
它会在编辑器内部显示意外警报等错误。
虽然代码可以运行,但我不想在编辑器中看到这些错误。
如何自定义 WebIde 以不显示此类错误。
最佳答案
虽然不鼓励在您的代码中使用console.log
和alert
语句,因为
[...] such messages are considered to be for debugging purposes and therefore not suitable to ship to the client [...]
http://eslint.org/docs/rules/no-console
和
[...] JavaScripts’ alert, confirm, and prompt functions are widely considered to be obtrusive as UI elements and should be replaced by a more appropriate custom UI implementation [...]
http://eslint.org/docs/rules/no-alert
您可以将 Linter 配置为绕过这些检查(尽管我不建议这样做)
但请记住,这些检查并非特定于 SAPUI5 或 Web IDE,而是针对每个 Javascript 项目!
无论如何,由于 Web IDE 使用 ESLint,要禁用检查,请在受影响的 Javascript 文件顶部添加以下内容:
/*eslint-disable no-console, no-alert */
关于sapui5 - 为什么 WebIde 显示 alert 和 console.log 错误?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40104214/
我正在使用 sapui5 创建一个表。我想知道我是否可以将升序排序和降序排序的默认图标更改为我自己的图标? 补充问题:有没有一种方法可以在标题中显示我的自定义图标而无需先点击它? 最佳答案 只需在 W
我如何在 SapUI5 中构建一个 XML View 来迭代 JSONModel 中的所有元素? 到目前为止,我有一个 Controller : sap.ui.define([ "sap/ui
我是一名优秀的程序员,十分优秀!