在用bootstrap table时用到删除某一行的方法removeByUniqueId, 一直报错bootstrap-table.js:2427 Uncaught TypeError: Cannot read property 'hasOwnProperty' of undefined
image.png
官方文档就是这样用的:
$table.bootstrapTable('removeByUniqueId', 1);
,
挣扎一段时间终于找到了原因,在bootstrap table.js源码中发现uniqueId未定义
image.png
在设置bootstrap table参数时加上uniqueId: "id"
即可
image.png