This repository has been archived on 2022-05-05. You can view files and clone it, but cannot push or open issues or pull requests.
userausfall/src/mixins.ts

24 lines
568 B
TypeScript

import Component from "vue-class-component";
import Vue from "vue";
@Component
export class NotifyMixin extends Vue {
public showError(): void {
this.showMessage("Es ist leider ein Fehler aufgetreten.", "is-danger");
}
showSuccess(message: string): void {
this.showMessage(message, "is-success");
}
showWarning(message: string): void {
this.showMessage(message, "is-warning");
}
private showMessage(
message: string,
type: "is-success" | "is-danger" | "is-warning"
): void {
this.$buefy.toast.open({ message, type });
}
}