Chips are compact elements that represent an input, attribute, or action.
筹码是表示输入,属性或动作的紧凑元素。
An example of rendering multiple Chips from an array of values. Deleting a chip removes it from the array. Note that since no onClick property is defined, the Chip can be focused, but does not gain depth while clicked or touched.
从值数组呈现多个Chip的示例。 删除芯片会将其从阵列中删除。 请注意,由于未定义onClick属性,因此可以使Chip聚焦,但在单击或触摸时不会增加深度。
There are some basic steps to implement chips in ReactJs.
在ReactJs中实现芯片有一些基本步骤。
In this function, I am using the underscore library for delete value from the array you can use any other or basic javascript function.
在此函数中,我使用underscore库从数组中删除值,您可以使用任何其他或基本的javascript函数。
That’s it for this time! I hope you enjoyed this post. As always, I welcome questions, notes, comments and requests for posts on topics you’d like to read. See you next time! Happy Coding !!!!!!
这次就是这样! 希望您喜欢这篇文章。 与往常一样,我欢迎您提出关于您要阅读的主题的问题,注释,评论和帖子请求。 下次见! 快乐编码!!!!!!
翻译自: https://medium.com/@rajputankit22/how-to-add-chips-value-in-an-array-in-reactjs-135c1c9956d4