@@ -806,9 +806,9 @@ Scoped field slots give you greater control over how the record data appears. Yo
806806slots to provided custom rendering for a particular field. If you want to add an extra field which
807807does not exist in the records, just add it to the [ ` fields ` ] ( #fields-column-definitions ) array, and
808808then reference the field(s) in the scoped slot(s). Scoped field slots use the following naming
809- syntax: ` 'cell[ ' + field key + '] ' ` .
809+ syntax: ` 'cell( ' + field key + ') ' ` .
810810
811- You can use the default _ fall-back_ scoped slot ` 'cell[] ' ` to format any cells that do not have an
811+ You can use the default _ fall-back_ scoped slot ` 'cell() ' ` to format any cells that do not have an
812812explicit scoped slot provided.
813813
814814** Example: Custom data rendering with scoped slots**
@@ -818,22 +818,22 @@ explicit scoped slot provided.
818818 <div >
819819 <b-table small :fields =" fields" :items =" items" >
820820 <!-- A virtual column -->
821- <template v-slot:cell[ index] =" data" >
821+ <template v-slot:cell( index) =" data" >
822822 {{ data.index + 1 }}
823823 </template >
824824
825825 <!-- A custom formatted column -->
826- <template v-slot:cell[ name] =" data" >
827- <b >{{ data.value.last }}</b >, {{ data.value.first }}
826+ <template v-slot:cell( name) =" data" >
827+ <b class = " text-info " >{{ data.value.last.toUpperCase() }}</b >, < b > {{ data.value.first }}< b >
828828 </template >
829829
830830 <!-- A virtual composite column -->
831- <template v-slot:cell[ nameage] =" data" >
831+ <template v-slot:cell( nameage) =" data" >
832832 {{ data.item.name.first }} is {{ data.item.age }} years old
833833 </template >
834834
835835 <!-- Optional default data cell scoped slot -->
836- <template v-slot:cell[] =" data" >
836+ <template v-slot:cell() =" data" >
837837 <i >{{ data.value }}</i >
838838 </template >
839839 </b-table >
@@ -903,7 +903,7 @@ scoped field slot.
903903<template >
904904 <div >
905905 <b-table :items =" items" >
906- <template v-slot:cell[ html] =" data" >
906+ <template v-slot:cell( html) =" data" >
907907 <span v-html =" data.value" ></span >
908908 </template >
909909 </b-table >
@@ -954,7 +954,7 @@ formatted value as a string (HTML strings are not supported)
954954<template >
955955 <div >
956956 <b-table :fields =" fields" :items =" items" >
957- <template v-slot:cell[ name] =" data" >
957+ <template v-slot:cell( name) =" data" >
958958 <!-- `data.value` is the value after formatted by the Formatter -->
959959 <a :href =" `#${data.value.replace(/[^a-z]+/i,'-').toLowerCase()}`" >{{ data.value }}</a >
960960 </template >
@@ -1017,34 +1017,34 @@ It is also possible to provide custom rendering for the tables `thead` and `tfoo
10171017default the table footer is not rendered unless ` foot-clone ` is set to ` true ` .
10181018
10191019Scoped slots for the header and footer cells uses a special naming convention of
1020- ` 'head[ <fieldkey>] ' ` and ` 'foot[ <fieldkey>] ' ` respectively. if a ` 'foot[ ...] ' ` slot for a field is
1021- not provided, but a ` 'head[ ...] ' ` slot is provided, then the footer will use the ` 'head[ ...] ' ` slot
1020+ ` 'head( <fieldkey>) ' ` and ` 'foot( <fieldkey>) ' ` respectively. if a ` 'foot( ...) ' ` slot for a field is
1021+ not provided, but a ` 'head( ...) ' ` slot is provided, then the footer will use the ` 'head( ...) ' ` slot
10221022content.
10231023
1024- You can use a default _ fall-back_ scoped slot ` 'head[] ' ` or ` 'foot[] ' ` to format any header or
1024+ You can use a default _ fall-back_ scoped slot ` 'head() ' ` or ` 'foot() ' ` to format any header or
10251025footer cells that do not have an explicit scoped slot provided.
10261026
10271027``` html
10281028<template >
10291029 <div >
10301030 <b-table :fields =" fields" :items =" items" foot-clone >
10311031 <!-- A custom formatted data column cell -->
1032- <template v-slot:cell[ name] =" data" >
1032+ <template v-slot:cell( name) =" data" >
10331033 {{ data.value.first }} {{ data.value.last }}
10341034 </template >
10351035
10361036 <!-- A custom formatted header cell for field 'name' -->
1037- <template v-slot:head[ name] =" data" >
1038- <span class =" text-info" >{{ data.label }}</b >
1037+ <template v-slot:head( name) =" data" >
1038+ <span class =" text-info" >{{ data.label.toUpperCase() }}</b >
10391039 </template >
10401040
10411041 <!-- A custom formatted footer cell for field 'name' -->
1042- <template v-slot:foot[ name] =" data" >
1042+ <template v-slot:foot( name) =" data" >
10431043 <span class =" text-danger" >{{ data.label }}</span >
10441044 </template >
10451045
10461046 <!-- Default fall-back custom formatted footer cell -->
1047- <template v-slot:foot[] =" data" >
1047+ <template v-slot:foot() =" data" >
10481048 <i >{{ data.label }}</i >
10491049 </template >
10501050 </b-table >
@@ -1088,7 +1088,7 @@ properties:
10881088| ` selectAllRows ` | Method | Select all rows (applicable if the table is in [ ` selectable ` ] ( #row-select-support ) mode |
10891089| ` clearSelected ` | Method | Unselect all rows (applicable if the table is in [ ` selectable ` ] ( #row-select-support ) mode |
10901090
1091- When placing inputs, buttons, selects or links within a ` HEAD[ ...] ` or ` FOOT[ ...] ` slot, note that
1091+ When placing inputs, buttons, selects or links within a ` head( ...) ` or ` foot( ...) ` slot, note that
10921092` head-clicked ` event will not be emitted when the input, select, textarea is clicked (unless they
10931093are disabled). ` head-clicked ` will never be emitted when clicking on links or buttons inside the
10941094scoped slots (even when disabled)
@@ -1117,7 +1117,7 @@ rather than native browser table child elements.
11171117 >
11181118 <template v-slot:thead-top =" data" >
11191119 <b-tr >
1120- <b-td colspan =" 2" >& nbsp ; </ b-td >
1120+ <b-th colspan =" 2" >< span class = " sr-only " >Name and ID</ span ></ b-th >
11211121 <b-th variant =" secondary" >Type 1</b-th >
11221122 <b-th variant =" primary" colspan =" 3" >Type 2</b-th >
11231123 <b-th variant =" danger" >Type 3</b-th >
@@ -1250,11 +1250,11 @@ available horizontal space.
12501250- Bootstrap v4 uses the CSS style ` border-collapse: collapsed ` on table elements. This prevents the
12511251 borders on the sticky header from "sticking" to the header, and hence the borders will scroll when
12521252 the body scrolls. To get around this issue, create some custom CSS that targets
1253- ` table.table.b-table ` , which sets they styles ` border-collapse: collapsed ; border-spacing: 0px; `
1253+ ` table.table.b-table ` , which sets they styles ` border-collapse: separate ; border-spacing: 0px; `
12541254 (note that this may cause double borders when using features such as ` bordered ` , etc).
1255- - The sticky header feature uses CSS style ` position: sticky ` to position the headings.
1256- - Internet Explorer does not support ` position: sticky ` , hence for IE11 the table headings will
1257- scroll with the table body.
1255+ - The sticky header feature uses CSS style ` position: sticky ` to position the headings. Internet
1256+ Explorer does not support ` position: sticky ` , hence for IE11 the table headings will scroll with
1257+ the table body.
12581258
12591259### Sticky columns
12601260
@@ -1272,10 +1272,10 @@ set.
12721272 <b-form-checkbox v-model =" stickyHeader" class =" mb-2" >Sticky header</b-form-checkbox >
12731273 <b-table :sticky-header =" stickyHeader" responsive :items =" items" :fields =" fields" >
12741274 <!-- We are using utility class `text-nowrap` to help illustrate horizontal scrolling -->
1275- <template v-slot:head[id] =" scope" >
1275+ <template v-slot:head(id) =" scope" >
12761276 <div class =" text-nowrap" >Row ID</div >
12771277 </template >
1278- <template v-slot:head[] =" scope" >
1278+ <template v-slot:head() =" scope" >
12791279 <div class =" text-nowrap" >
12801280 Heading {{ scope.label }}
12811281 </div >
@@ -1379,7 +1379,7 @@ initially showing.
13791379<template >
13801380 <div >
13811381 <b-table :items =" items" :fields =" fields" striped responsive =" sm" >
1382- <template v-slot:cell[ show_details] =" row" >
1382+ <template v-slot:cell( show_details) =" row" >
13831383 <b-button size =" sm" @click =" row.toggleDetails" class =" mr-2" >
13841384 {{ row.detailsShowing ? 'Hide' : 'Show'}} Details
13851385 </b-button >
@@ -1486,7 +1486,7 @@ Programmatic selection notes:
14861486 responsive =" sm"
14871487 >
14881488 <!-- Example scoped slot for select state illustrative purposes -->
1489- <template v-slot:cell[ selected] =" { rowSelected }" >
1489+ <template v-slot:cell( selected) =" { rowSelected }" >
14901490 <template v-if =" rowSelected" >
14911491 <span aria-hidden =" true" >&check ; </span >
14921492 <span class =" sr-only" >Selected</span >
@@ -2652,8 +2652,8 @@ helper components are as follows:
26522652
26532653These components are optimized to handle converting variants to the appropriate classes (such as
26542654handling table ` dark ` mode), and automatically applying certain accessibility attributes (i.e.
2655- ` role ` s and ` scope ` s). It can generate the stacked table and sticky- header requirements. Components
2656- ` <b-table> ` and ` <b-table-lite> ` use these helper components internally.
2655+ ` role ` s and ` scope ` s). They also can generate the stacked table, and sticky header and column,
2656+ markup. Components ` <b-table> ` and ` <b-table-lite> ` use these helper components internally.
26572657
26582658In the [ Simple tables] ( #simple-tables ) example, we are using the helper components ` <b-thead> ` ,
26592659` <b-tbody> ` , ` <b-tr> ` , ` <b-th> ` , ` <b-tr> ` and ` <b-tfoot> ` . While you can use regular table child
@@ -2697,9 +2697,10 @@ trigger your click on cells or rows (required for accessibility for keyboard-onl
26972697### Heading accessibility
26982698
26992699When a column (field) is sortable (` <b-table> ` only) or there is a ` head-clicked ` listener
2700- registered, the header (and footer) ` <th> ` cells will be placed into the document tab sequence (via
2701- ` tabindex="0" ` ) for accessibility by keyboard-only and screen reader users, so that the user may
2702- trigger a click (by pressing <kbd >ENTER</kbd > on the header cells.
2700+ registered (` <b-table> ` and ` <b-table-lite> ` ), the header (and footer) ` <th> ` cells will be placed
2701+ into the document tab sequence (via ` tabindex="0" ` ) for accessibility by keyboard-only and screen
2702+ reader users, so that the user may trigger a click (by pressing <kbd >ENTER</kbd > on the header
2703+ cells.
27032704
27042705### Data row accessibility
27052706
@@ -2881,11 +2882,11 @@ your app handles the various inconsistencies with events.
28812882 :sort-direction =" sortDirection"
28822883 @filtered =" onFiltered"
28832884 >
2884- <template v-slot:cell[ name] =" row" >
2885+ <template v-slot:cell( name) =" row" >
28852886 {{ row.value.first }} {{ row.value.last }}
28862887 </template >
28872888
2888- <template v-slot:cell[ actions] =" row" >
2889+ <template v-slot:cell( actions) =" row" >
28892890 <b-button size =" sm" @click =" info(row.item, row.index, $event.target)" class =" mr-1" >
28902891 Info modal
28912892 </b-button >
0 commit comments