Quantcast
Channel: Ionic Framework - Ionic Forum
Viewing all articles
Browse latest Browse all 48981

Why Ion Toggle its not working?

$
0
0
<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

Read full topic


Viewing all articles
Browse latest Browse all 48981

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>