ion-popover-controller
Ionic4项目中我们可以使用Ionic4弹出框组件ion-popover-controller对项目进行布局。 ion-popover-controller官方文档地址:https://ionicframework.com/docs/api/popover-controllerPopover controllers programmatically control the popover component. Popovers can be created and dismissed from the popover controller. View the
ion-popover-controller 用法(Usage)
async function presentPopover() {
const popoverController = document.querySelector('ion-popover-controller');
await popoverController.componentOnReady();
const popoverElement = await popoverController.create({
component: 'profile-page',
event: event
});
return await popoverElement.present();
}
ion-popover-controller 内置方法(Methods)
create | |
---|---|
Description | Create a popover overlay with popover options. |
Signature | create |
dismiss | |
Description | Dismiss the open popover overlay. |
Signature | dismiss(data?: any, role?: string | undefined, id?: string | undefined) => Promise |
getTop | |
Description | Get the most recently opened popover overlay. |
Signature | getTop() => Promise |