s/element/vuetify :D
This commit is contained in:
39
components/Snackbar.vue
Normal file
39
components/Snackbar.vue
Normal file
@@ -0,0 +1,39 @@
|
||||
<template lang='pug'>
|
||||
v-snackbar(
|
||||
v-model="active"
|
||||
:color="color"
|
||||
:bottom="bottom"
|
||||
:top="top"
|
||||
:left="left"
|
||||
:right="right"
|
||||
:timeout="timeout")
|
||||
v-icon.mr-3(color="white") {{icon}}
|
||||
span {{ message }}
|
||||
template(v-slot:action="{ }")
|
||||
v-icon(size="16" @click="active = false") mdi-close-circle
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data () {
|
||||
return {
|
||||
icon: 'md-alert',
|
||||
color: 'primary',
|
||||
bottom: true,
|
||||
top: false,
|
||||
left: false,
|
||||
right: true,
|
||||
active: false,
|
||||
timeout: 5000,
|
||||
message: ''
|
||||
}
|
||||
},
|
||||
created () {
|
||||
this.$root.$on('message', snackbar => {
|
||||
this.active = true
|
||||
this.message = snackbar.message
|
||||
this.color = snackbar.color || 'primary'
|
||||
})
|
||||
}
|
||||
}
|
||||
</script>
|
||||
Reference in New Issue
Block a user