Reactjs 在JSX中,如何将类名设置为string+;{prop}
我还不太熟悉如何反应,并尝试将类名设置为string+prop。但我不知道怎么做,也不知道这是否是最好的做法 所以我想做的是,这显然不起作用,是这样的:Reactjs 在JSX中,如何将类名设置为string+;{prop},reactjs,Reactjs,我还不太熟悉如何反应,并尝试将类名设置为string+prop。但我不知道怎么做,也不知道这是否是最好的做法 所以我想做的是,这显然不起作用,是这样的: <a data-featherlight='string' + {this.props.data.imageUrl}> 我该怎么写呢?您可以使用字符串连接 <a data-featherlight={'string' + this.props.data.imageUrl}> 可以使用字符串连接 <a dat
<a data-featherlight='string' + {this.props.data.imageUrl}>
我该怎么写呢?您可以使用字符串连接
<a data-featherlight={'string' + this.props.data.imageUrl}>
可以使用字符串连接
<a data-featherlight={'string' + this.props.data.imageUrl}>
您也可以试试:
<a data-featherlight={'string1' + this.props.data.imageUrl + 'string2'}>
<Link to={`getting-started/${this.props.message}`}>
<h1>Under {this.props.message}/-</h1>
</Link>
或
如果您使用的是链接组件,那么您可以像这样连接:
<a data-featherlight={'string1' + this.props.data.imageUrl + 'string2'}>
<Link to={`getting-started/${this.props.message}`}>
<h1>Under {this.props.message}/-</h1>
</Link>
在{this.props.message}下/-
您也可以试试:
<a data-featherlight={'string1' + this.props.data.imageUrl + 'string2'}>
<Link to={`getting-started/${this.props.message}`}>
<h1>Under {this.props.message}/-</h1>
</Link>
或
如果您使用的是链接组件,那么您可以像这样连接:
<a data-featherlight={'string1' + this.props.data.imageUrl + 'string2'}>
<Link to={`getting-started/${this.props.message}`}>
<h1>Under {this.props.message}/-</h1>
</Link>
在{this.props.message}下/-
据我所知,首先:
<a data-featherlight={'your string' + this.props.data.imageUrl}>
第二:
<a data-featherlight={`your string ${this.props.data.imageUrl}`}>
据我所知,首先:
<a data-featherlight={'your string' + this.props.data.imageUrl}>
第二:
<a data-featherlight={`your string ${this.props.data.imageUrl}`}>
这与2016年的公认答案有何不同?这与2016年的公认答案有何不同?我想将图标={faTwitter}
中的faTwitter
字符串与faTwitter
连接起来。但是,这不接受字符串
,因为它是IconProp
类型。我们如何克服这个问题?我想把faTwitter
和Twitter
的icon={faTwitter}
串接起来。但是,这不接受字符串
,因为它是IconProp
类型。我们如何克服这一点?