Skip to content
This repository was archived by the owner on Apr 1, 2021. It is now read-only.

Commit 7f2f2c7

Browse files
committed
add sweat alert 2 (swal)
1 parent 68fd115 commit 7f2f2c7

File tree

4 files changed

+69
-0
lines changed

4 files changed

+69
-0
lines changed

package-lock.json

Lines changed: 13 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@
5151
"vue-chartjs": "^3.3.2",
5252
"vue-notification": "^1.3.10",
5353
"vue-router": "^3.0.1",
54+
"vue-sweetalert2": "^1.4.2",
5455
"vuejs-datepicker": "^1.5.2",
5556
"vuex": "^3.0.1"
5657
},

resources/assets/js/coreui/main.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,14 @@ import BootstrapVue from 'bootstrap-vue'
55
import Datepicker from 'vuejs-datepicker'
66
import { id } from 'vuejs-datepicker/dist/locale'
77
import Notifications from 'vue-notification'
8+
import Sweetalert from 'vue-sweetalert2'
89
import App from './App'
910
import router from './router'
1011
import store from './store'
1112

1213
Vue.use(BootstrapVue)
1314
Vue.use(Notifications)
15+
Vue.use(Sweetalert)
1416

1517
Vue.component('b-datepicker', {
1618
extends: Datepicker,

resources/assets/js/coreui/views/notifications/Alerts.vue

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -233,6 +233,56 @@
233233
@click="showNotify('danger')">
234234
Danger
235235
</b-button>
236+
<p class="mt-3">
237+
See
238+
<a href="http://vue-notification.yev.io/">
239+
Documentations
240+
</a>
241+
for more information
242+
</p>
243+
</b-card>
244+
</b-col>
245+
<b-col
246+
cols="12"
247+
md="6">
248+
<b-card
249+
header-tag="header"
250+
footer-tag="footer">
251+
<div slot="header">
252+
<i class="fa fa-align-justify"/> Alerts <small>with <b>Sweat Alert 2</b></small>
253+
</div>
254+
<b-button
255+
variant="success"
256+
@click="showSwal('success')">
257+
Success
258+
</b-button>
259+
<b-button
260+
variant="warning"
261+
@click="showSwal('warning')">
262+
Warning
263+
</b-button>
264+
<b-button
265+
variant="danger"
266+
@click="showSwal('error')">
267+
Error
268+
</b-button>
269+
<b-button
270+
variant="info"
271+
@click="showSwal('info')">
272+
Info
273+
</b-button>
274+
<b-button
275+
variant="secondary"
276+
@click="showSwal('question')">
277+
Question
278+
</b-button>
279+
<p class="mt-3">
280+
See
281+
<a href="https://sweetalert2.github.io/">
282+
Documentations
283+
</a>
284+
for more information
285+
</p>
236286
</b-card>
237287
</b-col>
238288
</b-row>
@@ -264,6 +314,9 @@ export default {
264314
text : 'Hello user! This is a notification!',
265315
})
266316
},
317+
showSwal (type) {
318+
this.$swal('Hello Vue world!!!', 'This is Sweat Alert', type)
319+
},
267320
},
268321
}
269322
</script>

0 commit comments

Comments
 (0)