A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/bootstrap-vue/bootstrap-vue/commit/fca7bd5 below:

switch slot name syntax to use round bra… · bootstrap-vue/bootstrap-vue@fca7bd5 · GitHub

@@ -806,9 +806,9 @@ Scoped field slots give you greater control over how the record data appears. Yo

806 806

slots to provided custom rendering for a particular field. If you want to add an extra field which

807 807

does not exist in the records, just add it to the [`fields`](#fields-column-definitions) array, and

808 808

then 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 + ')'`.

810 810 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

812 812

explicit scoped slot provided.

813 813 814 814

**Example: Custom data rendering with scoped slots**

@@ -818,22 +818,22 @@ explicit scoped slot provided.

818 818

<div>

819 819

<b-table small :fields="fields" :items="items">

820 820

<!-- A virtual column -->

821 -

<template v-slot:cell[index]="data">

821 +

<template v-slot:cell(index)="data">

822 822

{{ data.index + 1 }}

823 823

</template>

824 824 825 825

<!-- 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>

828 828

</template>

829 829 830 830

<!-- A virtual composite column -->

831 -

<template v-slot:cell[nameage]="data">

831 +

<template v-slot:cell(nameage)="data">

832 832

{{ data.item.name.first }} is {{ data.item.age }} years old

833 833

</template>

834 834 835 835

<!-- Optional default data cell scoped slot -->

836 -

<template v-slot:cell[]="data">

836 +

<template v-slot:cell()="data">

837 837

<i>{{ data.value }}</i>

838 838

</template>

839 839

</b-table>

@@ -903,7 +903,7 @@ scoped field slot.

903 903

<template>

904 904

<div>

905 905

<b-table :items="items">

906 -

<template v-slot:cell[html]="data">

906 +

<template v-slot:cell(html)="data">

907 907

<span v-html="data.value"></span>

908 908

</template>

909 909

</b-table>

@@ -954,7 +954,7 @@ formatted value as a string (HTML strings are not supported)

954 954

<template>

955 955

<div>

956 956

<b-table :fields="fields" :items="items">

957 -

<template v-slot:cell[name]="data">

957 +

<template v-slot:cell(name)="data">

958 958

<!-- `data.value` is the value after formatted by the Formatter -->

959 959

<a :href="`#${data.value.replace(/[^a-z]+/i,'-').toLowerCase()}`">{{ data.value }}</a>

960 960

</template>

@@ -1017,34 +1017,34 @@ It is also possible to provide custom rendering for the tables `thead` and `tfoo

1017 1017

default the table footer is not rendered unless `foot-clone` is set to `true`.

1018 1018 1019 1019

Scoped 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

1022 1022

content.

1023 1023 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

1025 1025

footer cells that do not have an explicit scoped slot provided.

1026 1026 1027 1027

```html

1028 1028

<template>

1029 1029

<div>

1030 1030

<b-table :fields="fields" :items="items" foot-clone>

1031 1031

<!-- A custom formatted data column cell -->

1032 -

<template v-slot:cell[name]="data">

1032 +

<template v-slot:cell(name)="data">

1033 1033

{{ data.value.first }} {{ data.value.last }}

1034 1034

</template>

1035 1035 1036 1036

<!-- 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>

1039 1039

</template>

1040 1040 1041 1041

<!-- A custom formatted footer cell for field 'name' -->

1042 -

<template v-slot:foot[name]="data">

1042 +

<template v-slot:foot(name)="data">

1043 1043

<span class="text-danger">{{ data.label }}</span>

1044 1044

</template>

1045 1045 1046 1046

<!-- Default fall-back custom formatted footer cell -->

1047 -

<template v-slot:foot[]="data">

1047 +

<template v-slot:foot()="data">

1048 1048

<i>{{ data.label }}</i>

1049 1049

</template>

1050 1050

</b-table>

@@ -1088,7 +1088,7 @@ properties:

1088 1088

| `selectAllRows` | Method | Select all rows (applicable if the table is in [`selectable`](#row-select-support) mode |

1089 1089

| `clearSelected` | Method | Unselect all rows (applicable if the table is in [`selectable`](#row-select-support) mode |

1090 1090 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

1092 1092

`head-clicked` event will not be emitted when the input, select, textarea is clicked (unless they

1093 1093

are disabled). `head-clicked` will never be emitted when clicking on links or buttons inside the

1094 1094

scoped slots (even when disabled)

@@ -1117,7 +1117,7 @@ rather than native browser table child elements.

1117 1117

>

1118 1118

<template v-slot:thead-top="data">

1119 1119

<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>

1121 1121

<b-th variant="secondary">Type 1</b-th>

1122 1122

<b-th variant="primary" colspan="3">Type 2</b-th>

1123 1123

<b-th variant="danger">Type 3</b-th>

@@ -1250,11 +1250,11 @@ available horizontal space.

1250 1250

- Bootstrap v4 uses the CSS style `border-collapse: collapsed` on table elements. This prevents the

1251 1251

borders on the sticky header from "sticking" to the header, and hence the borders will scroll when

1252 1252

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;`

1254 1254

(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.

1258 1258 1259 1259

### Sticky columns

1260 1260

@@ -1272,10 +1272,10 @@ set.

1272 1272

<b-form-checkbox v-model="stickyHeader" class="mb-2">Sticky header</b-form-checkbox>

1273 1273

<b-table :sticky-header="stickyHeader" responsive :items="items" :fields="fields">

1274 1274

<!-- 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">

1276 1276

<div class="text-nowrap">Row ID</div>

1277 1277

</template>

1278 -

<template v-slot:head[]="scope">

1278 +

<template v-slot:head()="scope">

1279 1279

<div class="text-nowrap">

1280 1280

Heading {{ scope.label }}

1281 1281

</div>

@@ -1379,7 +1379,7 @@ initially showing.

1379 1379

<template>

1380 1380

<div>

1381 1381

<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">

1383 1383

<b-button size="sm" @click="row.toggleDetails" class="mr-2">

1384 1384

{{ row.detailsShowing ? 'Hide' : 'Show'}} Details

1385 1385

</b-button>

@@ -1486,7 +1486,7 @@ Programmatic selection notes:

1486 1486

responsive="sm"

1487 1487

>

1488 1488

<!-- Example scoped slot for select state illustrative purposes -->

1489 -

<template v-slot:cell[selected]="{ rowSelected }">

1489 +

<template v-slot:cell(selected)="{ rowSelected }">

1490 1490

<template v-if="rowSelected">

1491 1491

<span aria-hidden="true">&check;</span>

1492 1492

<span class="sr-only">Selected</span>

@@ -2652,8 +2652,8 @@ helper components are as follows:

2652 2652 2653 2653

These components are optimized to handle converting variants to the appropriate classes (such as

2654 2654

handling 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.

2657 2657 2658 2658

In the [Simple tables](#simple-tables) example, we are using the helper components `<b-thead>`,

2659 2659

`<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

2697 2697

### Heading accessibility

2698 2698 2699 2699

When 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.

2703 2704 2704 2705

### Data row accessibility

2705 2706

@@ -2881,11 +2882,11 @@ your app handles the various inconsistencies with events.

2881 2882

:sort-direction="sortDirection"

2882 2883

@filtered="onFiltered"

2883 2884

>

2884 -

<template v-slot:cell[name]="row">

2885 +

<template v-slot:cell(name)="row">

2885 2886

{{ row.value.first }} {{ row.value.last }}

2886 2887

</template>

2887 2888 2888 -

<template v-slot:cell[actions]="row">

2889 +

<template v-slot:cell(actions)="row">

2889 2890

<b-button size="sm" @click="info(row.item, row.index, $event.target)" class="mr-1">

2890 2891

Info modal

2891 2892

</b-button>


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4