gpt4 book ai didi

reactjs - React Google 登录内联样式

转载 作者:行者123 更新时间:2023-12-03 23:36:20 27 4
gpt4 key购买 nike

我正在使用 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
}}
/>

Plugin对此的任何帮助都会有所帮助。

最佳答案

似乎不可能,您可以使用自定义渲染方法。

 <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}
/>

您可以查看 here , 来自外部 css 文件的 css 规则将被忽略。您可以阅读 herehere

或者您可以使用替代插件: react-google-button

关于reactjs - React Google 登录内联样式,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55023073/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com