我使用多种渲染方法渲染按钮,但发现很难管理其样式。
这是我渲染按钮的代码
const [abc,setabc] = useState([
{ type: 'aa'},{ type: 'bb'},{ type: 'cc'},{ type: 'dd'},{ type: 'ee'},{ type: 'ff'},{ type: 'gg'},{ type: 'hh'},{ type: 'ii'},{ type: 'jj'},{ type: 'kk'},{ type: 'll'},{ type: 'mm'},{ type: 'nn'},{ type: 'oo'},{ type: 'pp'},{ type: 'qq'},{ type: 'rr'},{ type: 'ss'},{ type: 'tt'},{ type: 'uu'},{ type: 'vv'},{ type: 'ww'},{ type: 'xx'},{ type: 'yy'},{ type: 'zz'},])
const renderedABC = abc.map(item => {
return <Button key={item.type} title={item.type}/>;
})
它显示为
我想增加一行并单独显示。至少它填补了“空白” 在底部。