dwqs / v2-table

A simple table component based Vue 2.x: https://dwqs.github.io/v2-table/
MIT License
100 stars 24 forks source link

row-class-name attribute function return the row with undefined #16

Closed sknightq closed 6 years ago

sknightq commented 6 years ago

The following code in table-body.js on line 44. I found the this.row is undefined, I replaced it with this.rows[index], then will be OK.

if (typeof this.table.rowClassName !== 'undefined') {
  const customRowClass = typeof this.table.rowClassName === 'function' ? this.table.rowClassName({ row: this.row, rowIndex: index }) : this.table.rowClassName;
  cls.push(typeof customRowClass === 'string' ? customRowClass : '');
}
dwqs commented 6 years ago

@sknightq Thks