ffplayout/stores/index.ts

25 lines
623 B
TypeScript
Raw Normal View History

2023-01-11 04:54:25 -05:00
import { defineStore } from 'pinia'
export const useIndex = defineStore('index', {
state: () => ({
showAlert: false,
alertVariant: 'alert-success',
2023-01-11 04:54:25 -05:00
alertMsg: '',
}),
getters: {},
actions: {
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
},
},
})