16 lines
365 B
TypeScript
16 lines
365 B
TypeScript
import { toastController } from '@ionic/vue'
|
|
|
|
export function useIonToast() {
|
|
async function showToast(message: string, color: 'success' | 'danger' | 'warning' = 'success') {
|
|
const toast = await toastController.create({
|
|
message,
|
|
duration: 2000,
|
|
color,
|
|
position: 'bottom',
|
|
})
|
|
await toast.present()
|
|
}
|
|
|
|
return { showToast }
|
|
}
|