之前没有接触过react,现在需要修改代码
React.createElement(
'th',
{ key: key, style: { 'width': col.width ? col.width : 'auto' } },
colContent,
React.createElement(
'i',null,'点击'
)
)
现在想给生成的i标签添加点击事件,请问该怎么做
之前没有接触过react,现在需要修改代码
React.createElement(
'th',
{ key: key, style: { 'width': col.width ? col.width : 'auto' } },
colContent,
React.createElement(
'i',null,'点击'
)
)
现在想给生成的i标签添加点击事件,请问该怎么做
10 回答11.1k 阅读
6 回答3k 阅读
5 回答4.8k 阅读✓ 已解决
4 回答3.1k 阅读✓ 已解决
2 回答2.7k 阅读✓ 已解决
3 回答1.8k 阅读✓ 已解决
3 回答2.3k 阅读✓ 已解决
createElement()
的调用方式如下:绑定事件写在
[props]
中,例如:DEMO:
https://codepen.io/CodingMonk...