我正在使用 google-login 包。我试图更新按钮的背景图像和尺寸,它似乎不起作用还是我做错了?我在文档中找不到关于如何实现内联样式的任何示例。我刚刚读到它是一个对象,这是我的代码。
<GoogleLogin
className="rounded-circle"
icon={false}
clientId={process.env.REACT_APP_CLIENT_ID}
buttonText=""
onSuccess={this.responseGoogle}
onFailure={this.responseGoogle}
style={{ backgroundImage:url(${val.image.url}),
width:50,
height:50
}}
/>
Run Code Online (Sandbox Code Playgroud)
插件对此的任何帮助都会有所帮助。
Jay*_*vel 10
似乎不可能,您可以使用自定义渲染方法。
<GoogleLogin
clientId="658977310896-knrl3gka66fldh83dao2rhgbblmd4un9.apps.googleusercontent.com"
render={renderProps => (
<button onClick={renderProps.onClick} style={customStyle}>This is my custom Google button</button>
)}
buttonText="Login"
onSuccess={responseGoogle}
onFailure={responseGoogle}
/>
Run Code Online (Sandbox Code Playgroud)
您可以在此处查看,忽略来自外部 css 文件的 css 规则。您可以在此处和此处阅读
或者您可以使用替代插件:react-google-button
| 归档时间: |
|
| 查看次数: |
4813 次 |
| 最近记录: |