2020-02-28 14:47:55 +01:00
|
|
|
<template>
|
2020-05-07 14:02:03 +02:00
|
|
|
<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,
|
|
|
|
},
|
2020-05-07 14:02:03 +02:00
|
|
|
|
|
|
|
isFixed: {
|
|
|
|
type: Boolean,
|
|
|
|
default: false
|
|
|
|
}
|
2020-02-28 14:47:55 +01:00
|
|
|
},
|
|
|
|
|
|
|
|
methods: {
|
|
|
|
|
|
|
|
close (event) {
|
|
|
|
if (event) {
|
|
|
|
this.show = false
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
</script>
|