reactjs - 如何抑制 Typescript CSSProperties 错误
问题描述
我正在尝试使用以下代码:
public render() {
return (
<div>
<button style={{WebkitAppearance: '-apple-pay-button'}}/>
</div>
);
}
因为目前在 CSSProperties 类型中没有定义苹果支付按钮,所以我收到类型不兼容的错误。
我怎样才能抑制这个错误?
解决方案
如果错误来自打字稿使用
// @ts-ignore
如果她来自 tslint
/* tslint:disable */
<button style={{WebkitAppearance: '-apple-pay-button'}}/>
/* tslint:enable */
推荐阅读
- node.js - 如何在 Gandi(或其他托管公司)上托管 nodeJS ReactJS 应用程序?
- android - 如何使用“Safe Casts”进行大于或小于的比较
- python - 将横向连接查询转换为 sqlalchemy
- c++ - 代码在运行时崩溃,但在调试时不崩溃
- python - 熊猫有条件地创建多列
- html - 将搜索栏与 flex-container 内的右侧对齐
- html - 如何从输入中删除密码提示
- c# - 抓取 JavaScript 动态生成的数据
- android - RCConnection 错误:setSDP 错误:无法设置远程提供 sip:使用没有 DTLS 指纹的 SDP 调用
- javascript - 一段时间后点击事件丢失