[学习笔记] boostrap table removeByUniqueId使用小坑

在用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
最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容