问题描述
我在 vue 组件中使用 DataTable。
$(this.$el).DataTable({
data: this.rows,columns: this.cols,rowGroup: this.rowGroupData || null,.....
调用表:
if (this.dtHandle) {
this.dtHandle.clear();
this.dtHandle.rows.add(this.tableData);
console.log("data");
console.log(this.tableData);
this.dtHandle.draw();
}
但是我调用 this.dtHandle.draw() 时出错;
TypeError: d.trim is not a function
如何解决?
解决方法
表中的数据类型无效。转移到桌子前检查。