Member-only story
Mobile Development with Ionic and Vue — Action Sheets and Alerts
3 min readJan 25, 2021
If we know how to create Vue web apps but want to develop mobile apps, we can use the Ionic framework.
In this article, we’ll look at how to get started with mobile development with the Ionic framework with Vue.
Action Sheet
We can display an action sheet with Ionic and Vue.
To do that, we can write:
<template>
<ion-page>
<ion-content>
<ion-button @click="presentActionSheet">Show Action Sheet</ion-button>
</ion-content>
</ion-page>
</template><script>
import { IonButton, actionSheetController } from "@ionic/vue";
import { defineComponent } from "vue";
import { caretForwardCircle, close, heart, trash, share } from "ionicons/icons";export default defineComponent({
components: { IonButton },
methods: {
async presentActionSheet() {
const actionSheet = await actionSheetController.create({
header: "Albums",
cssClass: "my-custom-class",
buttons: [
{
text: "Delete",
role: "destructive",
icon: trash,
handler: () => {
console.log("Delete clicked");
},
},
{
text: "Play (open modal)",
icon…