ion-popover-controller

概要(CONTENTS)

Ionic4项目中我们可以使用Ionic4弹出框组件ion-popover-controller对项目进行布局。ion-popover-controller中有ionic ion-popover-controller 用法(Usage) ,ionic ion-popover-controller 内置方法(Methods)等

Popover controllers programmatically control the popover component. Popovers can be created and dismissed from the popover controller. View the Popover documentation for a full list of options to pass upon creation.

ion-popover-controller 用法(Usage)

javascript
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(opts: PopoverOptions) => Promise

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