<template>
<ion-page>
<ion-content class="ion-padding">
<ion-button @click="openPopover">Open Popover</ion-button>
</ion-content>
</ion-page>
</template>
<script>
import { IonButton, IonContent, IonPage, popoverController } from '@ionic/vue';
import Popver from './popover.vue';
export default {
components: { IonButton, IonContent, IonPage },
methods: {
async openPopover(ev: Event) {
const popover = await popoverController.create({
component: Popover,
cssClass: 'my-custom-class',
event: ev,
translucent: true,
});
await popover.present();
const { role } = await popover.onDidDismiss();
console.log('onDidDismiss resolved with role', role);
},
},
};
</script>