Member-only story

Mobile Development with Ionic and Vue — Badge, Button, and Card

John Au-Yeung
3 min readJan 25, 2021

--

Photo by Katherine Kromberg on Unsplash

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.

Badge

We can add a badge with Ionic Vue.

For example, we can use the ion-badge component to add a badge:

<template>
<ion-page>
<ion-content>
<ion-badge color="primary">11</ion-badge>
</ion-content>
</ion-page>
</template>
<script>
import { IonBadge, IonItem, IonLabel } from "@ionic/vue";
import { defineComponent } from "vue";
export default defineComponent({
components: { IonBadge, IonItem, IonLabel },
});
</script>

We can also put them in an ion-item container:

<template>
<ion-page>
<ion-content>
<ion-item>
<ion-badge slot="start">11</ion-badge>
<ion-label>My Item</ion-label>
<ion-badge slot="end">22</ion-badge>
</ion-item>
</ion-content>
</ion-page>
</template>
<script>
import { IonBadge, IonItem, IonLabel } from "@ionic/vue";
import { defineComponent } from "vue";
export default defineComponent({…

--

--

No responses yet