At some point, you might want to override or format the values in the row cells. vue-bootstrap4-table allow you to achieve that with the help of vue slotting.
Example
SlotExample.vue
...<vue-bootstrap4-table :rows="rows" :columns="columns" :config="config"> <template slot="email"slot-scope="props"> <i> {{props.cell_value}} </i> </template> <templateslot="name_first_name"slot-scope="props"> <b> {{props.cell_value}} </b> </template> <templateslot="lastname"slot-scope="props"> <b> {{props.cell_value}} </b> </template></vue-bootstrap4-table>...<script>...columns: [{ label: "First Name", name: "name.first_name"// access nested objects properties with "." }, { label: "Last Name", name: "name.last_name",// access nested objects properties with "." slot_name: "lastname"// optional, if you don't provide slot name //then default slot name will be name_last_name }, { label: "Email", name: "email" }],...</script>
Slot name will be same as the name which you provided in the columns configuration. In the above example, slot="email" represents the "email" column in the table.
Note
You might have some columns getting the values from nested objects from rows. In that case, the slot name will be column name and dots(.) in the column name will be replaced by underscore(_).
You can see the above example, slot name for name.first_name column is name_first_name.
If you don't like this default "slot name" assignment, then you can set names to row slots as shown in the above example.
props
From slot-scope="props" you can access the following attributes.