我正在尝试使用以下代码:
public render() {
return (
<div>
<button style={{WebkitAppearance: '-apple-pay-button'}}/>
</div>
);
}
由于CSSProperties类型中当前没有定义苹果付款按钮,因此出现类型不兼容错误。
如何抑制此错误?
答案 0 :(得分:0)
如果错误来自打字稿,则使用
// @ts-ignore
如果她来自tslint
/* tslint:disable */
<button style={{WebkitAppearance: '-apple-pay-button'}}/>
/* tslint:enable */
答案 1 :(得分:0)
我担心此问题的最快解决方案是使用样式化的组件包装您的组件,或者只是向其添加css类并将其样式化在您的捆绑css中