【发布时间】:2022-02-24 21:00:42
【问题描述】:
所以当我在 react 中创建 DataTable 时,使用 columnDefs 属性定义某个列。
"columnDefs": [
{
"targets": 7,
"data": "data",
"render": function ( data, type, full, meta ) {
return "<button onclick='test()'>view</button>"
}
}
]
但正如预期的那样,它找不到test() 函数。反正有没有做这种 jsx 风格的东西?还是我只需要在 onclick 中创建函数?
【问题讨论】:
标签: javascript reactjs datatables