【发布时间】:2020-04-21 11:55:10
【问题描述】:
在 reactjs 中如何使用模板 html 数据渲染组件?
class Options extends React.Component {
render() {
const othList = [];
[1, 2, 3, 4, 5].forEach((t) => {
othList.push(t);
});
return othList;
}
}
如何传递 html 数据并使用提供的 html 作为模板?
<Options><div></div></Options>
所以上面将呈现 5 个 div,主要是 1 个等。
或者
<Options><td></td></Options> 将渲染 5 个 td
谢谢
【问题讨论】:
标签: javascript html reactjs composition