<template>
<ion-content>
<ion-list>
<ion-item>
<ion-label>Toggle Example</ion-label>
{{toppings}}
<ion-toggle
@ionChange="toppings.value.push($event.target.value)"
value="pepperoni"
:checked="toppings.value.indexOf('pepperoni') !== -1">
>
</ion-toggle>
</ion-item>
</ion-list>
</ion-content>
</template>
<script lang="ts">
import { defineComponent, onMounted, ref } from 'vue';
import {
IonContent,
IonList,
IonLabel,
IonItem,
IonToggle
} from '@ionic/vue';
export default defineComponent({
components: {
IonContent,
IonList,
IonLabel,
IonItem,
IonToggle
},
setup() {
const toppings = ref([]);
return {
toppings,
}
}
});
</script>
1 post - 1 participant