2023-01-11 04:54:25 -05:00
|
|
|
import { defineStore } from 'pinia'
|
|
|
|
|
|
|
|
export const useIndex = defineStore('index', {
|
|
|
|
state: () => ({
|
|
|
|
showAlert: false,
|
2023-01-11 07:41:22 -05:00
|
|
|
alertVariant: 'alert-success',
|
2023-01-11 04:54:25 -05:00
|
|
|
alertMsg: '',
|
|
|
|
}),
|
|
|
|
|
|
|
|
getters: {},
|
|
|
|
actions: {
|
2024-02-21 08:23:20 -05:00
|
|
|
msgAlert(variance: string, text: string, seconds: number = 3) {
|
|
|
|
this.alertVariant = variance
|
|
|
|
this.alertMsg = text
|
|
|
|
this.showAlert = true
|
|
|
|
|
|
|
|
setTimeout(() => {
|
|
|
|
this.showAlert = false
|
|
|
|
this.alertVariant = 'alert-success'
|
|
|
|
this.alertMsg = ''
|
|
|
|
}, seconds * 1000);
|
2023-01-11 04:54:25 -05:00
|
|
|
},
|
|
|
|
},
|
|
|
|
})
|