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">
|
2021-01-17 18:57:57 +01: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"
|
2021-01-17 18:57:57 +01:00
|
|
|
></div>
|
2020-03-02 21:19:26 +01:00
|
|
|
<div
|
2020-09-05 22:35:52 +02:00
|
|
|
class="notification-content"
|
|
|
|
v-html="props.item.text"
|
2021-01-17 18:57:57 +01:00
|
|
|
></div>
|
2020-09-05 22:35:52 +02:00
|
|
|
<div
|
|
|
|
class="buttons is-right"
|
2021-01-17 18:57:57 +01:00
|
|
|
v-if="
|
|
|
|
props.item.data &&
|
|
|
|
props.item.data.actions &&
|
|
|
|
props.item.data.actions.length > 0
|
|
|
|
"
|
|
|
|
>
|
|
|
|
<x-button
|
|
|
|
:key="'action_' + i"
|
2020-09-05 22:35:52 +02:00
|
|
|
@click="action.callback"
|
2021-01-17 18:57:57 +01:00
|
|
|
:shadow="false"
|
|
|
|
class="is-small"
|
|
|
|
v-for="(action, i) in props.item.data.actions"
|
|
|
|
>
|
2020-03-02 21:19:26 +01:00
|
|
|
{{ action.title }}
|
2021-01-17 18:57:57 +01:00
|
|
|
</x-button>
|
2020-03-02 21:19:26 +01:00
|
|
|
</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-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 {
|
2021-01-17 18:57:57 +01:00
|
|
|
margin-top: 0.5em;
|
2020-09-05 22:35:52 +02:00
|
|
|
}
|
2020-03-02 21:19:26 +01:00
|
|
|
</style>
|