之前没有接触过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标签添加点击事件,请问该怎么做
13 回答12.6k 阅读
7 回答1.7k 阅读
3 回答1k 阅读✓ 已解决
3 回答1.2k 阅读✓ 已解决
2 回答1.1k 阅读✓ 已解决
4 回答1.5k 阅读
2 回答1.8k 阅读
createElement()
的调用方式如下:绑定事件写在
[props]
中,例如:DEMO:
https://codepen.io/CodingMonk...