【发布时间】:2018-06-26 23:46:51
【问题描述】:
我正在尝试设置 React-Stripe-Elements,虽然我能够获得要渲染的基本表单,但它以一种非常时髦的方式进行。我什至尝试从我在网上找到的表单中添加 CSS,但它无法在 CardElement 中正确呈现。如何让 React-Stripe-Elements 使用正确的 UI 或与文档中的 UI 很相似的 UI 进行渲染?
CardElement 当前呈现如下:
我的卡片元素文件看起来像:
import React from 'react';
import {CardElement} from 'react-stripe-elements';
class CardSection extends React.Component {
render() {
return (
<label>
Card details
<CardElement style= {{ base: { color: '#fff',
fontWeight: 500,
fontFamily: 'Roboto, Open Sans, Segoe UI, sans-serif',
fontSize: '15px',
fontSmoothing: 'antialiased' }}} />
</label>
);
}
};
export default CardSection;
【问题讨论】:
标签: javascript css reactjs stripe-payments