mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-11-10 00:27:41 +08:00
docs(): update usage and examples
This commit is contained in:
@ -27,7 +27,7 @@ export class ActionSheetController implements OverlayController {
|
||||
removeLastOverlay(this.actionSheets);
|
||||
}
|
||||
|
||||
/*
|
||||
/**
|
||||
* Create an action sheet overlay with action sheet options.
|
||||
*/
|
||||
@Method()
|
||||
@ -35,7 +35,7 @@ export class ActionSheetController implements OverlayController {
|
||||
return createOverlay(this.doc.createElement('ion-action-sheet'), opts);
|
||||
}
|
||||
|
||||
/*
|
||||
/**
|
||||
* Dismiss the open action sheet overlay.
|
||||
*/
|
||||
@Method()
|
||||
@ -43,7 +43,7 @@ export class ActionSheetController implements OverlayController {
|
||||
return dismissOverlay(data, role, this.actionSheets, actionSheetId);
|
||||
}
|
||||
|
||||
/*
|
||||
/**
|
||||
* Get the most recently opened action sheet overlay.
|
||||
*/
|
||||
@Method()
|
||||
|
||||
@ -2,52 +2,6 @@
|
||||
|
||||
Action Sheet controllers programmatically control the action sheet component. Action Sheets can be created and dismissed from the action sheet controller. View the [Action Sheet](../../action-sheet/ActionSheet) documentation for a full list of options to pass upon creation.
|
||||
|
||||
```javascript
|
||||
async function presentBasic() {
|
||||
const actionSheetController = document.querySelector('ion-action-sheet-controller');
|
||||
await actionSheetController.componentOnReady();
|
||||
|
||||
const actionSheetElement = await actionSheetController.create({
|
||||
header: "Albums",
|
||||
buttons: [{
|
||||
text: 'Delete',
|
||||
role: 'destructive',
|
||||
icon: 'trash',
|
||||
handler: () => {
|
||||
console.log('Delete clicked');
|
||||
}
|
||||
}, {
|
||||
text: 'Share',
|
||||
icon: 'share',
|
||||
handler: () => {
|
||||
console.log('Share clicked');
|
||||
}
|
||||
}, {
|
||||
text: 'Play (open modal)',
|
||||
icon: 'arrow-dropright-circle',
|
||||
handler: () => {
|
||||
console.log('Play clicked');
|
||||
}
|
||||
}, {
|
||||
text: 'Favorite',
|
||||
icon: 'heart',
|
||||
handler: () => {
|
||||
console.log('Favorite clicked');
|
||||
}
|
||||
}, {
|
||||
text: 'Cancel',
|
||||
icon: 'close',
|
||||
role: 'cancel',
|
||||
handler: () => {
|
||||
console.log('Cancel clicked');
|
||||
}
|
||||
}]
|
||||
});
|
||||
await actionSheetElement.present();
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
<!-- Auto Generated Below -->
|
||||
|
||||
|
||||
@ -55,12 +9,18 @@ async function presentBasic() {
|
||||
|
||||
#### create()
|
||||
|
||||
Create an action sheet overlay with action sheet options.
|
||||
|
||||
|
||||
#### dismiss()
|
||||
|
||||
Dismiss the open action sheet overlay.
|
||||
|
||||
|
||||
#### getTop()
|
||||
|
||||
Get the most recently opened action sheet overlay.
|
||||
|
||||
|
||||
|
||||
----------------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user