2π
β
In your example, you would need to set col.format
to be the actual function, not the name of the function:
let date_format = Vue.filter('date_format');
let money_format = Vue.filter('money_format');
let cols = [
{ field: 'dt_joined', format: date_format },
{ field: 'dt_trained', format: date_format },
{ field: 'salary', format: money_format }
]
Then foo | col.format
will apply the function being pointed at by col.format
to the foo
variable before rendering it.
π€thanksd
Source:stackexchange.com