Files
s-ui/frontend/src/store/modules/message.ts
T
Alireza Ahmadi f40b27fd8b initial commit
2024-02-13 01:17:54 +01:00

22 lines
447 B
TypeScript

import { defineStore } from 'pinia'
const Message = defineStore('msg', {
state: () => ({
showMsg: false,
snackbar: {
message: '',
timeout: 5000,
color: '',
}
}),
actions: {
showMessage(message:string, color='success',timeout=5000) {
this.snackbar.message = message
this.snackbar.color = color
this.snackbar.timeout = timeout
this.showMsg = true
}
},
})
export default Message