[英]credit card style issue
我正在尝试更改信用卡输入的边框颜色,但它无法正常工作
这是creditcardinput的文档 。 这是一个应用绿色自定义边框颜色的演示 。 这里托管在codesandbox上
<CreditCardInput
cardNumberInputProps={{ }}
cardExpiryInputProps={{ }}
cardCVCInputProps={{ }}
style={ { border: '2px solid yellow' } }
/>
您需要使用fieldStyle
或containerStyle
prop而不是style
prop。 使用其中任何一个似乎都会产生相同的结果,至少在您共享的代码框示例中,尽管在您的代码更改时两者之间可能存在差异。
从可用的道具文档 :
containerStyle | object (optional) | {} | Style for the field container fieldStyle | object (optional) | {} | Style for the field
例:
function App() {
return (
<div className="App">
<CreditCardInput
cardNumberInputProps={{ }}
cardExpiryInputProps={{ }}
cardCVCInputProps={{ }}
fieldStyle={ { border: '2px solid yellow' } }
/>
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.