2021-07-28 16:39:32 +02:00
|
|
|
{{- /* Usage: js-dismiss "ComponentName" */ -}}
|
|
|
|
|
|
|
|
{{- $name := .Get 0 -}}
|
|
|
|
|
2023-03-10 18:23:59 +01:00
|
|
|
Dismissal can be achieved with the `data-bs-dismiss` attribute on a button **within the {{ $name }}** as demonstrated below:
|
2021-07-28 16:39:32 +02:00
|
|
|
|
|
|
|
```html
|
|
|
|
<button type="button" class="btn-close" data-bs-dismiss="{{ $name }}" aria-label="Close"></button>
|
|
|
|
```
|
|
|
|
|
2023-03-10 18:23:59 +01:00
|
|
|
or on a button **outside the {{ $name }}** using the additional `data-bs-target` as demonstrated below:
|
2021-07-28 16:39:32 +02:00
|
|
|
|
|
|
|
```html
|
|
|
|
<button type="button" class="btn-close" data-bs-dismiss="{{ $name }}" data-bs-target="#my-{{ $name }}" aria-label="Close"></button>
|
|
|
|
```
|