在创建可选择的 Card React 组件方面需要帮助
Need help in creating a selectable Card React component
我正在尝试创建一个 selectable Card 组件,同时当我单击按钮时,边框会更改为所有元素。当时我需要一个 selection,所以当我 select 第一张卡时,第二张和第三张没有边框。
代码如下:https://codesandbox.io/s/optimistic-mcnulty-4w15m?file=/src/App.js
我已经修复了你的代码。你现在可以检查它
https://codesandbox.io/s/angry-heyrovsky-0gwqp?file=/src/App.js
我正在尝试创建一个 selectable Card 组件,同时当我单击按钮时,边框会更改为所有元素。当时我需要一个 selection,所以当我 select 第一张卡时,第二张和第三张没有边框。
代码如下:https://codesandbox.io/s/optimistic-mcnulty-4w15m?file=/src/App.js
我已经修复了你的代码。你现在可以检查它 https://codesandbox.io/s/angry-heyrovsky-0gwqp?file=/src/App.js