我正在尝试使用与vue.js v-on
指令相关联的Tabulator(一个JavaScript表库)中的deleteRow()方法从表底部删除行,但是它不起作用。
我尝试使用table.deleteRow(1)
(根据文档,arg是行索引),但是尽管索引为1行,但返回错误。
methods: {
myDeleteRow: this.anyTable.deleteRow(1)
}
}
tabulator.js?6dbe:7464 Uncaught (in promise) Delete Error - No matching row found
(anonymous) @ tabulator.js?6dbe:7464
Tabulator.deleteRow @ tabulator.js?6dbe:7447
myDeleteRow @ TermsConditions.vue?2be7:95
invoker @ vue.esm.js?efeb:2128
fn._withTask.fn._withTask @ vue.esm.js?efeb:1913
Delete Error - No matching row found: 1
tabulator.js?6dbe:7464 Uncaught (in promise) Delete Error - No matching row found
(anonymous) @ tabulator.js?6dbe:7464
Tabulator.deleteRow @ tabulator.js?6dbe:7447
myDeleteRow @ TermsConditions.vue?2be7:95
invoker @ vue.esm.js?efeb:2128
fn._withTask.fn._withTask @ vue.esm.js?efeb:1913
答案 0 :(得分:0)
是的,deleteRow(index)
的参数称为index
,但它更多地充当记录ID。如果查看表配置对象上的index
选项,则index
是与您指定的表数据的每个记录关联的ID字段。制表符对实际的行数索引执行操作时并没有真正的帮助,因此您必须严重依赖某种行标识符。