Skip to content

Commit

Permalink
allow functions as rowClassCallbacks too
Browse files Browse the repository at this point in the history
  • Loading branch information
c0defre4k committed Mar 15, 2017
1 parent 004fc45 commit 395cb20
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/components/Vuetable.vue
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ export default {
default: 'alt'
},
rowClassCallback: {
type: String,
type: [String, Function],
default: ''
},
detailRowComponent: {
Expand Down Expand Up @@ -693,6 +693,10 @@ export default {
}
},
onRowClass: function(dataItem, index) {
if(typeof(this.rowClassCallback) === 'function') {
return this.rowClassCallback(dataItem, index)
}
let func = this.rowClassCallback.trim()
if (func !== '' && typeof this.$parent[func] === 'function') {
Expand Down

0 comments on commit 395cb20

Please sign in to comment.