Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
306 views
in Technique[技术] by (71.8m points)

javascript - 带图标的React-Bootstrap按钮(React-bootstrap button with icon)

I can add a button with text in react-bootstrap using code like(我可以使用类似的代码在react-bootstrap中添加带有文本的按钮)

<Button className={styles.feedbackButtonRating} variant={this.state.liked ? 'success' : 'light'} onClick={this.handleOnLikeClick} > {FEEDBACK_LIKE_BUTTON_TEXT} </Button> Is there a way to replace {FEEDBACK_LIKE_BUTTON_TEXT} text with a thumb up icon?(有没有办法用大拇指图标替换{FEEDBACK_LIKE_BUTTON_TEXT}文本?)   ask by sixtytrees translate from so

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

You can try out using this npm package react-icons(您可以尝试使用此npm包react-icons)

import { FaThumbsUp } from 'react-icons/fa'; <Button> <FaThumbsUp /> </Button>

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...