58 lines
1.3 KiB
Vue
58 lines
1.3 KiB
Vue
<template>
|
|
<div></div>
|
|
</template>
|
|
<script>
|
|
import { toast } from "vue3-toastify";
|
|
export default {
|
|
name: "ToastMessage",
|
|
mixins: [],
|
|
components: {},
|
|
props: ["type", "message", "timeout"],
|
|
data: () => ({}),
|
|
watch: {},
|
|
computed: {},
|
|
methods: {
|
|
triggerMounted() {
|
|
if (this.type == "error") {
|
|
toast(this.message, {
|
|
position: "bottom-center",
|
|
type: "error",
|
|
timeout: 3000,
|
|
closeOnClick: true,
|
|
pauseOnFocusLoss: true,
|
|
pauseOnHover: true,
|
|
draggable: true,
|
|
draggablePercent: 0.6,
|
|
showCloseButtonOnHover: false,
|
|
hideProgressBar: false,
|
|
closeButton: true,
|
|
icon: true,
|
|
rtl: false,
|
|
});
|
|
}
|
|
if (this.type == "success") {
|
|
toast(this.message, {
|
|
position: "bottom-center",
|
|
type: "success",
|
|
timeout: 3000,
|
|
closeOnClick: true,
|
|
pauseOnFocusLoss: true,
|
|
pauseOnHover: true,
|
|
draggable: true,
|
|
draggablePercent: 0.6,
|
|
showCloseButtonOnHover: false,
|
|
hideProgressBar: false,
|
|
closeButton: true,
|
|
icon: true,
|
|
rtl: false,
|
|
});
|
|
}
|
|
},
|
|
},
|
|
mounted() {
|
|
this.triggerMounted();
|
|
},
|
|
};
|
|
</script>
|
|
<style scoped></style>
|