Flutter教程

ion-popover-controller

概要(CONTENTS)

Ionic4项目中我们可以使用Ionic4弹出框组件ion-popover-controller对项目进行布局。

ion-popover-controller官方文档地址:https://ionicframework.com/docs/api/popover-controller

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)

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(options: 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