我想在反应中制作具有两个垂直对齐按钮的组件
I want to make a component with increment and decrement functionality. Increment and decrement arrow buttons are aligned vertically and a text on the right side of those buttons which is the counter and a reset button under it.
Here is the component that I want:
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我制作了一个与您想要的非常相似的简单代码:
这是我在 App.js 中编写的代码(您可以稍后将代码移动到独立组件中):
现在这是应用程序.css内容(用于样式):
注意:要使图标正常工作,您需要在
标记内的“public/index.html”中添加这段代码:
我希望这个简单的解决方案有所帮助你知道了。
i made a simple code that is quite similar to what you want :
Here is the Code i wrote in App.js ( you can move the code later to in independant component ) :
Now here is the App.css content ( for styling ) :
Note: for the icons to work you need to add this piece of code in "public/index.html" inside the
<header>
tag :I hope this simple solution helps you get an idea .