Skip to content

Commit fd8eb39

Browse files
author
Pooya Parsa
committed
Alerts demo example
1 parent 783f5cd commit fd8eb39

File tree

4 files changed

+51
-0
lines changed

4 files changed

+51
-0
lines changed

examples/alerts/demo.css

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#app {
2+
padding: 20px;
3+
height: 400px;
4+
}

examples/alerts/demo.details

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
name: Alerts demo - BootstrapVue
2+
description: Please see BootstrapVue docs for more information https://bootstrap-vue.github.io
3+
authors:
4+
- Pooya Parsa
5+
resources:
6+
- https://unpkg.com/bootstrap@next/dist/css/bootstrap.min.css
7+
- https://unpkg.com/bootstrap-vue@latest/dist/bootstrap-vue.css
8+
- https://unpkg.com/vue@latest/dist/vue.min.js
9+
- https://unpkg.com/tether@latest/dist/js/tether.min.js
10+
- https://unpkg.com/bootstrap-vue@latest/dist/bootstrap-vue.js

examples/alerts/demo.html

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
<div id="app">
2+
<b-alert show>
3+
Default Alert
4+
</b-alert>
5+
6+
<b-alert state="success" show>
7+
Success Alert
8+
</b-alert>
9+
10+
<b-alert state="danger" dismissible :show="showDismissibleAlert" @dismissed="showDismissibleAlert=false">
11+
Dismissible Alert!
12+
</b-alert>
13+
14+
<b-alert :show="dismissCountDown" dismissible state="warning" @dismiss-count-down="countDownChanged">
15+
This alert will dismiss after {{dismissCountDown}} seconds...
16+
</b-alert>
17+
18+
<b-btn @click="showAlert" variant="info" class="m-1">Show alert with count-down timer</b-btn>
19+
<b-btn @click="showDismissibleAlert=true" variant="info" class="m-1">
20+
Show dismissible alert ({{showDismissibleAlert?'visible':'hidden'}})
21+
</b-btn>
22+
</div>

examples/alerts/demo.js

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
new Vue({
2+
el: '#app',
3+
data: {
4+
dismissCountDown: null,
5+
showDismissibleAlert: false
6+
},
7+
methods: {
8+
countDownChanged(dismissCountDown) {
9+
this.dismissCountDown = dismissCountDown;
10+
},
11+
showAlert() {
12+
this.dismissCountDown = 5;
13+
}
14+
}
15+
});

0 commit comments

Comments
 (0)