2FAuth/resources/js/components/Notification.vue

50 lines
1002 B
Vue
Raw Normal View History

2020-02-28 14:47:55 +01:00
<template>
<div class="notification" :class="[type, isFixed ? 'is-fixed' : '']" v-if="show">
2020-02-28 14:47:55 +01:00
<button class="delete" v-if="isDeletable" @click="close"></button>
{{ message }}
</div>
</template>
<script>
export default {
name: 'Notification',
data() {
return {
show: true
}
},
props: {
type: {
type: String,
default: 'is-primary'
},
message: {
type: String,
default: '',
},
isDeletable: {
type: Boolean,
default: true,
},
isFixed: {
type: Boolean,
default: false
}
2020-02-28 14:47:55 +01:00
},
methods: {
close (event) {
if (event) {
this.show = false
}
}
}
}
</script>