platypush/platypush/backend/http/webapp/src/utils/Notification.vue

29 lines
408 B
Vue
Raw Normal View History

2020-11-21 01:12:08 +01:00
<script>
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
},
notifyWarning(msg) {
2020-12-14 02:13:55 +01:00
this.notify({
text: msg,
warning: true,
})
},
notifyError(msg) {
2020-11-21 01:12:08 +01:00
this.notify({
text: msg,
error: true,
})
throw msg
},
}
}
</script>