For the three-button component as shown in the picture, how can we simply use native JS and REACT to write a simple way of clicking one of the buttons to change the style of one of the buttons? And when clicking other buttons, you can have the same effect (that is, clear the styles of the other two and add the style of the click button)
The click of the button is maintained by state, whether it is clicked. Different states give different styles~~
The second question is that you can definitely only write one p style. It is impossible to write 3 buttons for 3 buttons and 10 buttons for 10 buttons. . . . Make a traversal of the basic data, render many p, give p a default style, and assign a different key to each p to distinguish
This is a modal component. Clicking different buttons will pop up the corresponding content~~~
Set a selected field for each button, select one and clear the other two.
Dynamicly add styles to buttons based on the selected value.
Can be implemented using the radio of input