[英]credit card style issue
I am trying to change the border color of credit card input, yet it is not working 我正在尝试更改信用卡输入的边框颜色,但它无法正常工作
Here is documentation for creditcardinput. 这是creditcardinput的文档 。 Here is a demo where green custom border color is applied.
这是一个应用绿色自定义边框颜色的演示 。 Here is hosted on codesandbox
这里托管在codesandbox上
<CreditCardInput
cardNumberInputProps={{ }}
cardExpiryInputProps={{ }}
cardCVCInputProps={{ }}
style={ { border: '2px solid yellow' } }
/>
You need to use the fieldStyle
or containerStyle
prop instead of the style
prop. 您需要使用
fieldStyle
或containerStyle
prop而不是style
prop。 Using either seems to produce the same results at least in the codesandbox example you've shared, though there may be differences between the two as your code changes. 使用其中任何一个似乎都会产生相同的结果,至少在您共享的代码框示例中,尽管在您的代码更改时两者之间可能存在差异。
From the available props documentation : 从可用的道具文档 :
containerStyle | object (optional) | {} | Style for the field container fieldStyle | object (optional) | {} | Style for the field
Example: 例:
function App() {
return (
<div className="App">
<CreditCardInput
cardNumberInputProps={{ }}
cardExpiryInputProps={{ }}
cardCVCInputProps={{ }}
fieldStyle={ { border: '2px solid yellow' } }
/>
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.