8000 chore(docs): use new slot syntax everywhere by jacobmllr95 · Pull Request #5895 · bootstrap-vue/bootstrap-vue · GitHub
[go: up one dir, main page]

Skip to content

chore(docs): use new slot syntax everywhere #5895

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Oct 13, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/components/avatar/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -385,7 +385,7 @@ Add textual content to the badge by supplying a string to the `badge` prop, or u
<b-avatar badge="BV"></b-avatar>
<b-avatar badge="7" variant="primary" badge-variant="dark"></b-avatar>
<b-avatar badge-variant="info" src="https://placekitten.com/300/300">
<template v-slot:badge><b-icon icon="star-fill"></b-icon></template>
<template #badge><b-icon icon="star-fill"></b-icon></template>
</b-avatar>
</div>
</template>
Expand Down
22 changes: 11 additions & 11 deletions src/components/card/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -217,12 +217,12 @@ You can control the wrapper element tags used by setting the `header-tag` and `f
</b-card>

<b-card title="Title" header-tag="header" footer-tag="footer">
<template v-slot:header>
<template #header 10000 >
<h6 class="mb-0">Header Slot</h6>
</template>
<b-card-text>Header and footers using slots.</b-card-text>
<b-button href="#" variant="primary">Go somewhere</b-button>
<template v-slot:footer>
<template #footer>
<em>Footer Slot</em>
</template>
</b-card>
Expand All @@ -247,7 +247,7 @@ card.
img-alt="Image"
img-top
>
<template v-slot:header>
<template #header>
<h4 class="mb-0">Hello World</h4>
</template>

Expand Down Expand Up @@ -510,7 +510,7 @@ Integrate [`<b-nav>`](/docs/components/nav) into card headers easily.
```html
<div>
<b-card title="Card Title" body-class="text-center" header-tag="nav">
<template v-slot:header>
<template #header>
<b-nav card-header tabs>
<b-nav-item active>Active</b-nav-item>
<b-nav-item>Inactive</b-nav-item>
Expand Down Expand Up @@ -580,7 +580,7 @@ When using card groups with footers, their content will automatically line up.
This is a wider card with supporting text below as a natural lead-in to additional content.
This content is a little bit longer.
</b-card-text>
<template v-slot:footer>
<template #footer>
<small class="text-muted">Last updated 3 mins ago</small>
</template>
</b-card>
Expand All @@ -589,7 +589,7 @@ When using card groups with footers, their content will automatically line up.
<b-card-text>
This card has supporting text below as a natural lead-in to additional content.
</b-card-text>
<template v-slot:footer>
<template #footer>
<small class="text-muted">Last updated 3 mins ago</small>
</template>
</b-card>
Expand All @@ -599,7 +599,7 @@ When using card groups with footers, their content will automatically line up.
This is a wider card with supporting text below as a natural lead-in to additional content.
This card has even longer content than the first to show that equal height action.
</b-card-text>
<template v-slot:footer>
<template #footer>
<small class="text-muted">Last updated 3 mins ago</small>
</template>
</b-card>
Expand All @@ -623,7 +623,7 @@ automatically line up.
This is a wider card with supporting text below as a natural lead-in to additional content.
This content is a little bit longer.
</b-card-text>
<template v-slot:footer>
<template #footer>
<small class="text-muted">Last updated 3 mins ago</small>
</template>
</b-card>
Expand All @@ -632,7 +632,7 @@ automatically line up.
<b-card-text>
This card has supporting text below as a natural lead-in to additional content.
</b-card-text>
<template v-slot:footer>
<template #footer>
<small class="text-muted">Last updated 3 mins ago</small>
</template>
</b-card>
Expand All @@ -642,7 +642,7 @@ automatically line up.
This is a wider card with supporting text below as a natural lead-in to additional content.
This card has even longer content than the first to show that equal height action.
</b-card-text>
<template v-slot:footer>
<template #footer>
<small class="text-muted">Last updated 3 mins ago</small>
</template>
</b-card>
Expand Down Expand Up @@ -716,7 +716,7 @@ set them to display: inline-block as column-break-inside: avoid isn't a bulletpr
This is a wider card with supporting text below as a natural lead-in to additional content.
This card has even longer content than the first.
</b-card-text>
<template v-slot:footer>
<template #footer>
<small class="text-muted">Footer Text</small>
</template>
</b-card>
Expand Down
2 changes: 1 addition & 1 deletion src/components/carousel/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
<!-- Slides with img slot -->
<!-- Note the classes .d-block and .img-fluid to prevent browser default image alignment -->
<b-carousel-slide>
<template v-slot:img>
<template #img>
<img
class="d-block img-fluid w-100"
width="1024"
Expand Down
4 changes: 2 additions & 2 deletions src/components/dropdown/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ precedence.
</b-dropdown>

<b-dropdown>
<template v-slot:button-content>
<template #button-content>
Custom <strong>Content</strong> with <em>HTML</em> via Slot
</template>
<b-dropdown-item href="#">An item</b-dropdown-item>
Expand Down Expand Up @@ -384,7 +384,7 @@ to `true`. This is useful when the dropdown is to be displayed as an icon.
```html
<div>
<b-dropdown size="lg" variant="link" toggle-class="text-decoration-none" no-caret>
F438 <template v-slot:button-content>
<template #button-content>
&#x1f50d;<span class="sr-only">Search</span>
</template>
<b-dropdown-item href="#">Action</b-dropdown-item>
Expand Down
2 changes: 1 addition & 1 deletion src/components/form-checkbox/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -734,7 +734,7 @@ modifier.
<template>
<div>
<b-form-group>
<template v-slot:label>
<template #label>
<b>Choose your flavours:</b><br>
<b-form-checkbox
v-model="allSelected"
Expand Down
2 changes: 1 addition & 1 deletion src/components/form-radio/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ To have them appear _above_ the inputs generated by `options`, place them in the
name="radio-options-slots"
>
<!-- Radios in this slot will appear first -->
<template v-slot:first>
<template #first>
<b-form-radio value="first">Toggle this custom radio from slot first</b-form-radio>
</template>

Expand Down
4 changes: 2 additions & 2 deletions src/components/form-select/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ options specified by the `options` prop, use the named slot `first`.
<div>
<b-form-select v-model="selected" :options="options" class="mb-3">
<!-- This slot appears above the options from 'options' prop -->
<template v-slot:first>
<template #first>
<b-form-select-option :value="null" disabled>-- Please select an option --</b-form-select-option>
</template>

Expand Down Expand Up @@ -313,7 +313,7 @@ option with an empty value as your first option.

```html
<b-form-select v-model="selected" :options="options">
<template v-slot:first>
<template #first>
<b-form-select-option value="" disabled>-- Please select an option --</b-form-select-option>
</template>
</b-form-select>
Expand Down
10 changes: 5 additions & 5 deletions src/components/form-tags/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -202,10 +202,10 @@ not validated.
separator=" "
></b-form-tags>
<!-- The following slots are for b-form-group -->
<template v-slot:invalid-feedback>
<template #invalid-feedback>
You must provide at least 3 tags and no more than 8
</template>
<template v-slot:description>
<template #description>
<div id="tags-validation-help">
Tags must be 3 to 5 characters in length and all lower
case. Enter tags separated by spaces or press enter.
Expand Down Expand Up @@ -571,7 +571,7 @@ of tags:
:disabled="disabled || availableOptions.length === 0"
:options="availableOptions"
>
<template v-slot:first>
<template #first>
<!-- This is required to prevent bugs with Safari -->
<option disabled value="">Choose a tag...</option>
</template>
Expand Down Expand Up @@ -605,7 +605,7 @@ If the custom input is using custom event names that mimic `input` and `change`,
`.native` modifier for keydown, you can do something similar to below to bind the event handlers:

```html
<template v-slot:default="{ inputAttrs, inputHandlers, removeTag, tags }">
<template #default="{ inputAttrs, inputHandlers, removeTag, tags }">
<custom-input
:id="inputAttrs.id"
:vistom-value-prop="inputAttrs.value"
Expand Down Expand Up @@ -732,7 +732,7 @@ pre-defined set of tags:
</ul>

<b-dropdown size="sm" variant="outline-secondary" block menu-class="w-100">
<template v-slot:button-content>
<template #button-content>
<b-icon icon="tag-fill"></b-icon> Choose tags
</template>
<b-dropdown-form @submit.stop.prevent="() => {}">
Expand Down
10 changes: 5 additions & 5 deletions src/components/input-group/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

<!-- Using slots -->
<b-input-group class="mt-3">
<template v-slot:append>
<template #append>
<b-input-group-text><strong class="text-danger">!</strong></b-input-group-text>
</template>
<b-form-input></b-form-input>
Expand Down Expand Up @@ -63,12 +63,12 @@ The slot content will automatically be wrapped by
```html
<div>
<b-input-group>
<template v-slot:prepend>
<template #prepend>
<b-input-group-text >Username</b-input-group-text>
</template>
<b-form-input></b-form-input>

<template v-slot:append>
<template #append>
<b-dropdown text="Dropdown" variant="success">
<b-dropdown-item>Action A</b-dropdown-item>
<b-dropdown-item>Action B</b-dropdown-item>
Expand Down Expand Up @@ -246,7 +246,7 @@ Multiple add-ons are supported and can be mixed with checkbox and radio input ve
```html
<div>
<b-input-group>
<template v-slot:prepend>
<template #prepend>
<b-dropdown text="Dropdown" variant="info">
<b-dropdown-item>Action A</b-dropdown-item>
<b-dropdown-item>Action B</b-dropdown-item>
Expand All @@ -255,7 +255,7 @@ Multiple add-ons are supported and can be mixed with checkbox and radio input ve

<b-form-input></b-form-input>

<template v-slot:append>
<template #append>
<b-dropdown text="Dropdown" variant="outline-secondary" v-for="i in 2" :key="i">
<b-dropdown-item>Action C</b-dropdown-item>
<b-dropdown-item>Action D</b-dropdown-item>
Expand Down
8 changes: 4 additions & 4 deletions src/components/jumbotron/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@ Anything else between the opening and closing tags will be rendered at the botto
```html
<div>
<b-jumbotron>
<template v-slot:header>BootstrapVue</template>
<template #header>BootstrapVue</template>

<template v-slot:lead>
<template #lead>
This is a simple hero unit, a simple jumbotron-style component for calling extra attention to
featured content or information.
</template>
Expand Down Expand Up @@ -87,9 +87,9 @@ jumbotron to use the default styling.
```html
<div>
<b-jumbotron bg-variant="info" text-variant="white" border-variant="dark">
<template v-slot:header>BootstrapVue</template>
<template #header>BootstrapVue</template>

<template v-slot:lead>
<template #lead>
This is a simple hero unit, a simple jumbotron-style component for calling extra attention to
featured content or information.
</template>
Expand Down
16 changes: 8 additions & 8 deletions src/components/media/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<div>
<b-card>
<b-media>
<template v-slot:aside>
<template #aside>
<b-img blank blank-color="#ccc" width="64" alt="placeholder"></b-img>
</template>

Expand All @@ -24,7 +24,7 @@
</p>

<b-media>
<template v-slot:aside>
<template #aside>
<b-img blank blank-color="#ccc" width="64" alt="placeholder"></b-img>
</template>

Expand All @@ -46,7 +46,7 @@
```html
<div>
<b-media>
<template v-slot:aside>
<template #aside>
<img src="..." alt="Media Aside">
</template>

Expand Down Expand Up @@ -81,7 +81,7 @@
</p>

<b-media>
<template v-slot:aside>
<template #aside>
<b-img blank blank-color="#ccc" width="64" alt="placeholder"></b-img>
</template>
<h5 class="mt-0">Nested Media</h5>
Expand All @@ -103,7 +103,7 @@ Change the order of content in media objects by adding `right-align` property.
```html
<div>
<b-media right-align vertical-align="center">
<template v-slot:aside>
<template #aside>
<b-img blank blank-color="#ccc" width="80" alt="placeholder"></b-img>
</template>
<h5 class="mt-0 mb-1">Media object</h5>
Expand Down Expand Up @@ -138,7 +138,7 @@ use spacing utilities wherever needed to fine tune.
<div>
<ul class="list-unstyled">
<b-media tag="li">
<template v-slot:aside>
<template #aside>
<b-img blank blank-color="#abc" width="64" alt="placeholder"></b-img>
</template>
<h5 class="mt-0 mb-1">List-based media object</h5>
Expand All @@ -150,7 +150,7 @@ use spacing utilities wherever needed to fine tune.
</b-media>

<b-media tag="li" class="my-4">
<template v-slot:aside>
<template #aside>
<b-img blank blank-color="#cba" width="64" alt="placeholder"></b-img>
</template>

Expand All @@ -163,7 +163,7 @@ use spacing utilities wherever needed to fine tune.
</b-media>

<b-media tag="li">
<template v-slot:aside>
<template #aside>
<b-img blank blank-color="#bac" width="64" alt="placeholder"></b-img>
</template>

Expand Down
10 changes: 5 additions & 5 deletions src/components/modal/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ Both methods return immediately after being called.
<b-button id="show-btn" @click="$bvModal.show('bv-modal-example')">Open Modal</b-button>

<b-modal id="bv-modal-example" hide-footer>
<template v-slot:modal-title>
<template #modal-title>
Using <code>$bvModal</code> Methods
</template>
<div class="d-block text-center">
Expand Down Expand Up @@ -555,7 +555,7 @@ the `header-border-variant` and `footer-border-variant` props respectively.
</b-row>
</b-container>

<template v-slot:modal-footer>
<template #modal-footer>
<div class="w-100">
<p class="float-left">Modal Footer Content</p>
<b-button
Expand Down Expand Up @@ -690,20 +690,20 @@ The scope available to the slots that support optional scoping are:
<b-button @click="$bvModal.show('modal-scoped')">Open Modal</b-button>

<b-modal id="modal-scoped">
<template v-slot:modal-header="{ close }">
<template #modal-header="{ close }">
<!-- Emulate built in modal header close button action -->
<b-button size="sm" variant="outline-danger" @click="close()">
Close Modal
</b-button>
<h5>Modal Header</h5>
</template>

<template v-slot:default="{ hide }">
<template #default="{ hide }">
<p>Modal Body with button</p>
<b-button @click="hide()">Hide Modal</b-button>
</template>

<template v-slot:modal-footer="{ ok, cancel, hide }">
<template #modal-footer="{ ok, cancel, hide }">
<b>Custom Footer</b>
<!-- Emulate built in modal footer ok and cancel button actions -->
<b-button size="sm" variant="success" @click="ok()">
Expand Down
Loading
0