2020-11-21 01:12:08 +01:00
|
|
|
<script>
|
2020-11-22 12:57:28 +01:00
|
|
|
import { bus } from "@/bus";
|
2020-11-21 01:12:08 +01:00
|
|
|
|
|
|
|
export default {
|
|
|
|
name: "Notification",
|
|
|
|
methods: {
|
|
|
|
notify(notification) {
|
2023-01-21 16:59:18 +01:00
|
|
|
bus.publishNotification(notification)
|
2020-11-21 01:12:08 +01:00
|
|
|
},
|
|
|
|
|
2023-01-14 22:27:43 +01:00
|
|
|
notifyWarning(msg) {
|
2020-12-14 02:13:55 +01:00
|
|
|
this.notify({
|
|
|
|
text: msg,
|
|
|
|
warning: true,
|
|
|
|
})
|
|
|
|
},
|
|
|
|
|
2023-01-14 22:27:43 +01:00
|
|
|
notifyError(msg) {
|
2020-11-21 01:12:08 +01:00
|
|
|
this.notify({
|
|
|
|
text: msg,
|
|
|
|
error: true,
|
|
|
|
})
|
|
|
|
|
|
|
|
throw msg
|
|
|
|
},
|
|
|
|
}
|
|
|
|
}
|
|
|
|
</script>
|