0

How would one go about applying a VueJS filter (i.e. {{ price | currency }}) to data displayed using vue-tables-2?

I tried playing around with slots with one of the demo tables to no avail: https://jsfiddle.net/jfa5t4sm/11/

This is a bit annoying, as 'custom filters' mean different things in different context, so searching the docs is not bearing fruit.

Anyone have ideas?

Joshua Swiss
  • 195
  • 1
  • 5
  • 17

1 Answers1

2

Since it's a scoped slot you have to access the value through the props object and give it the correct slot name.

  <template slot="price" scope="props">
    <div>
      <p>{{ props.row.price | currency }}</p>
    </div>
  </template>

Working JsFiddle

Steven B.
  • 8,962
  • 3
  • 24
  • 45