docs(action-sheet, alert, popover, toast): update usage to show onDidDismiss (#23133)

This commit is contained in:
William Martin
2021-04-02 13:00:36 -04:00
committed by GitHub
parent ef1a82f64a
commit b0d53ca736
20 changed files with 122 additions and 24 deletions

View File

@ -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);
},
},
});

View File

@ -50,6 +50,9 @@ export class ActionSheetExample {
}]
});
await actionSheet.present();
const { role } = await actionSheet.onDidDismiss();
console.log('onDidDismiss resolved with role', role);
}
}

View File

@ -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);
}
```

View File

@ -47,6 +47,9 @@ export class ActionSheetExample {
}]
});
await actionSheet.present();
const { role } = await actionSheet.onDidDismiss();
console.log('onDidDismiss resolved with role', role);
}
render() {

View File

@ -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);
},
},
});