@@ -168,7 +168,7 @@ with the dismiss button.
168
168
<!-- alert-dismis-1.vue -->
169
169
```
170
170
171
- ### Auto dismissing alerts:
171
+ ### Auto dismissing alerts
172
172
To create a ` <b-alert> ` that dismisses automatically after a period of time, set
173
173
the ` show ` prop to the number of seconds you would like the ` <b-alert> ` to remain visible for.
174
174
@@ -178,7 +178,7 @@ the `show` prop to the number of seconds you would like the `<b-alert>` to remai
178
178
<b-alert :show =" dismissCountDown"
179
179
dismissible
180
180
variant =" warning"
181
- @dismissed =" dismissCountdown =0"
181
+ @dismissed =" dismissCountDown =0"
182
182
@dismiss-count-down =" countDownChanged" >
183
183
This alert will dismiss after {{dismissCountDown}} seconds...
184
184
</b-alert >
@@ -210,4 +210,63 @@ export default {
210
210
<!-- alert-auto-dismiss-1.vue -->
211
211
```
212
212
213
+ ## Fading alerts
214
+ Use the ` fade ` prop to enable animation. By default alerts are not animated.
215
+
216
+ ``` html
217
+ <template >
218
+ <div >
219
+ <b-alert show dismissible fade >
220
+ Dismissible Alert!
221
+ </b-alert >
222
+
223
+ <b-alert variant =" danger"
224
+ dismissible
225
+ fade
226
+ :show =" showDismissibleAlert"
227
+ @dismissed =" showDismissibleAlert=false" >
228
+ Dismissible Alert!
229
+ </b-alert >
230
+
231
+ <b-alert :show =" dismissCountDown"
232
+ dismissible
233
+ fade
234
+ variant =" warning"
235
+ @dismissed =" dismissCountDown=0"
236
+ @dismiss-count-down =" countDownChanged" >
237
+ This alert will dismiss after {{dismissCountDown}} seconds...
238
+ </b-alert >
239
+
240
+ <b-btn @click =" showAlert" variant =" info" class =" m-1" >
241
+ Show alert with count-down timer
242
+ </b-btn >
243
+ <b-btn @click =" showDismissibleAlert=true" variant =" info" class =" m-1" >
244
+ Show dismissible alert ({{showDismissibleAlert?'visible':'hidden'}})
245
+ </b-btn >
246
+ </div >
247
+ </template >
248
+
249
+ <script >
250
+ export default {
251
+ data () {
252
+ return {
253
+ dismissSecs: 5 ,
254
+ dismissCountDown: 0 ,
255
+ showDismissibleAlert: false
256
+ }
257
+ },
258
+ methods: {
259
+ countDownChanged (dismissCountDown ) {
260
+ this .dismissCountDown = dismissCountDown
261
+ },
262
+ showAlert () {
263
+ this .dismissCountDown = this .dismissSecs
264
+ }
265
+ }
266
+ }
267
+ </script >
268
+
269
+ <!-- alert-fade-1.vue -->
270
+ ```
271
+
213
272
## Component Reference
0 commit comments