@@ -560,7 +560,7 @@ Custom rendering for each data field in a row is possible using either
560
560
or formatter callback function.
561
561
562
562
### Scoped Field Slots
563
- Scoped slots give you greater control over how the record data apepars .
563
+ Scoped slots give you greater control over how the record data appears .
564
564
If you want to add an extra field which does not exist in the records,
565
565
just add it to the ` fields ` array, And then reference the field(s) in the scoped
566
566
slot(s).
@@ -634,7 +634,7 @@ number will align with the indexes from the optional `v-model` bound variable._
634
634
> - _ When placing inputs, buttons, selects or links within a data cell scoped slot,
635
635
be sure to add a ` @click.stop ` (or ` @click.native.stop ` if needed) handler (which can
636
636
be empty) to prevent the click on the input, button, select, or link, from triggering
637
- the ` row-clicked ` event:_
637
+ the ` row-clicked ` event:_
638
638
639
639
``` html
640
640
<template slot =" actions" slot-scope =" cell" >
@@ -643,6 +643,35 @@ the `row-clicked` event:_
643
643
</template >
644
644
```
645
645
646
+ #### Displaying raw HTML
647
+ By default ` b-table ` escapes HTML tags in items, if you need to display raw HTML code in ` b-table ` , you should use
648
+ ` v-html ` prop in scoped field slot
649
+
650
+ ``` html
651
+ <template >
652
+ <b-table :items =" items" >
653
+ <span slot =" html" slot-scope =" data" v-html =" data.value" >
654
+ </span >
655
+ </b-table >
656
+ </template >
657
+
658
+ <script >
659
+ export default {
660
+ data () {
661
+ return {
662
+ items: [
663
+ {
664
+ text: ' This is <i>escaped</i> content' ,
665
+ html: ' This is <i>raw <strong>HTML</strong></i> <span style="color:red">content</span>'
666
+ }
667
+ ]
668
+ }
669
+ }
670
+ }
671
+ </script >
672
+
673
+ <!-- table-html-data-slots.vue -->
674
+ ```
646
675
647
676
### Formatter callback
648
677
One more option to customize field output is to use formatter callback function.
0 commit comments