26 lines
604 B
TypeScript
26 lines
604 B
TypeScript
import { toast } from "vue3-toastify";
|
|
// export function deleteItem (data:any, index:number) {
|
|
// try {
|
|
// data.splice(index,1)
|
|
// } catch (error) {
|
|
|
|
// }
|
|
// }
|
|
|
|
export function formTitle(index:number){
|
|
return index === -1 ? "New Item" : "Edit Item";
|
|
}
|
|
export function typeForm(index:number){
|
|
return index === -1 ? "create" : "edit";
|
|
}
|
|
|
|
export function deleteItem(data:any, index:number) {
|
|
return data.splice(index,1)
|
|
}
|
|
export function toastAlert(msg:string,type:any){
|
|
toast(msg, {
|
|
type: type,
|
|
dangerouslyHTMLString: true,
|
|
autoClose: 2000,
|
|
})
|
|
} |