2020-03-02 21:19:26 +01:00
|
|
|
<template>
|
2020-12-10 14:52:35 +01:00
|
|
|
<notifications position="bottom left" :max="2" class="global-notification">
|
2020-03-02 21:19:26 +01:00
|
|
|
<template slot="body" slot-scope="props">
|
2020-04-14 23:09:18 +02:00
|
|
|
<div :class="['vue-notification-template', 'vue-notification', props.item.type]" @click="close(props)">
|
2020-03-02 21:19:26 +01:00
|
|
|
<div
|
2020-09-05 22:35:52 +02:00
|
|
|
class="notification-title"
|
|
|
|
v-html="props.item.title"
|
|
|
|
v-if="props.item.title"
|
2020-03-02 21:19:26 +01:00
|
|
|
>
|
|
|
|
</div>
|
|
|
|
<div
|
2020-09-05 22:35:52 +02:00
|
|
|
class="notification-content"
|
|
|
|
v-html="props.item.text"
|
2020-03-02 21:19:26 +01:00
|
|
|
>
|
|
|
|
</div>
|
2020-09-05 22:35:52 +02:00
|
|
|
<div
|
|
|
|
class="buttons is-right"
|
|
|
|
v-if="props.item.data && props.item.data.actions && props.item.data.actions.length > 0">
|
2020-03-02 21:19:26 +01:00
|
|
|
<button
|
2020-09-05 22:35:52 +02:00
|
|
|
:key="'action_'+i"
|
|
|
|
@click="action.callback"
|
|
|
|
class="button noshadow is-small" v-for="(action, i) in props.item.data.actions">
|
2020-03-02 21:19:26 +01:00
|
|
|
{{ action.title }}
|
|
|
|
</button>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
</notifications>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
2020-09-05 22:35:52 +02:00
|
|
|
export default {
|
|
|
|
name: 'notification',
|
|
|
|
methods: {
|
|
|
|
close(props) {
|
|
|
|
props.close()
|
2020-04-14 23:09:18 +02:00
|
|
|
},
|
2020-09-05 22:35:52 +02:00
|
|
|
},
|
|
|
|
}
|
2020-03-02 21:19:26 +01:00
|
|
|
</script>
|
|
|
|
|
|
|
|
<style scoped>
|
2020-04-26 01:11:34 +02:00
|
|
|
|
2020-09-05 22:35:52 +02:00
|
|
|
.vue-notification {
|
|
|
|
z-index: 9999;
|
|
|
|
}
|
2020-04-26 01:11:34 +02:00
|
|
|
|
2020-09-05 22:35:52 +02:00
|
|
|
.buttons {
|
|
|
|
margin-top: .5em;
|
|
|
|
}
|
2020-03-02 21:19:26 +01:00
|
|
|
</style>
|