mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-11-10 00:27:41 +08:00
docs(action-sheet, alert, popover, toast): update usage to show onDidDismiss (#23133)
This commit is contained in:
@ -94,6 +94,9 @@ export class ActionSheetExample {
|
||||
}]
|
||||
});
|
||||
await actionSheet.present();
|
||||
|
||||
const { role } = await actionSheet.onDidDismiss();
|
||||
console.log('onDidDismiss resolved with role', role);
|
||||
}
|
||||
|
||||
}
|
||||
@ -147,7 +150,10 @@ async function presentActionSheet() {
|
||||
}
|
||||
}];
|
||||
document.body.appendChild(actionSheet);
|
||||
return actionSheet.present();
|
||||
await actionSheet.present();
|
||||
|
||||
const { role } = await actionSheet.onDidDismiss();
|
||||
console.log('onDidDismiss resolved with role', role);
|
||||
}
|
||||
```
|
||||
|
||||
@ -316,6 +322,9 @@ export class ActionSheetExample {
|
||||
}]
|
||||
});
|
||||
await actionSheet.present();
|
||||
|
||||
const { role } = await actionSheet.onDidDismiss();
|
||||
console.log('onDidDismiss resolved with role', role);
|
||||
}
|
||||
|
||||
render() {
|
||||
@ -389,7 +398,10 @@ export default defineComponent({
|
||||
},
|
||||
],
|
||||
});
|
||||
return actionSheet.present();
|
||||
await actionSheet.present();
|
||||
|
||||
const { role } = await actionSheet.onDidDismiss();
|
||||
console.log('onDidDismiss resolved with role', role);
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
@ -50,6 +50,9 @@ export class ActionSheetExample {
|
||||
}]
|
||||
});
|
||||
await actionSheet.present();
|
||||
|
||||
const { role } = await actionSheet.onDidDismiss();
|
||||
console.log('onDidDismiss resolved with role', role);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -38,6 +38,9 @@ async function presentActionSheet() {
|
||||
}
|
||||
}];
|
||||
document.body.appendChild(actionSheet);
|
||||
return actionSheet.present();
|
||||
await actionSheet.present();
|
||||
|
||||
const { role } = await actionSheet.onDidDismiss();
|
||||
console.log('onDidDismiss resolved with role', role);
|
||||
}
|
||||
```
|
||||
|
||||
@ -47,6 +47,9 @@ export class ActionSheetExample {
|
||||
}]
|
||||
});
|
||||
await actionSheet.present();
|
||||
|
||||
const { role } = await actionSheet.onDidDismiss();
|
||||
console.log('onDidDismiss resolved with role', role);
|
||||
}
|
||||
|
||||
render() {
|
||||
|
||||
@ -56,7 +56,10 @@ export default defineComponent({
|
||||
},
|
||||
],
|
||||
});
|
||||
return actionSheet.present();
|
||||
await actionSheet.present();
|
||||
|
||||
const { role } = await actionSheet.onDidDismiss();
|
||||
console.log('onDidDismiss resolved with role', role);
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user