Initial project scaffolding
This commit is contained in:
15
app/composables/useIonToast.ts
Normal file
15
app/composables/useIonToast.ts
Normal file
@@ -0,0 +1,15 @@
|
||||
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 }
|
||||
}
|
||||
Reference in New Issue
Block a user