Hi,
I just created a new project with ionic cli : ionic start --type=vue
So I use VueJS with Typescript and ionic 5.
Here’s my code in Home.vue
<template>
<ion-page>
<ion-header :translucent="true">
<ion-toolbar>
<ion-title>Blank</ion-title>
</ion-toolbar>
</ion-header>
<ion-content :fullscreen="true">
<ion-header collapse="condense">
<ion-toolbar>
<ion-title size="large">Blank</ion-title>
</ion-toolbar>
</ion-header>
<div id="container">
<strong>Ready to create an app?</strong>
<p>Start with Ionic <a target="_blank" rel="noopener noreferrer" href="https://ionicframework.com/docs/components">UI Components</a></p>
<!-- <IonCheckbox (ionChange)="test($event)" color="primary" /> -->
<ion-checkbox (ionChange)="test($event)" color="primary"></ion-checkbox>
</div>
</ion-content>
</ion-page>
</template>
<script lang="ts">
import { IonContent, IonHeader, IonPage, IonTitle, IonToolbar, IonCheckbox } from '@ionic/vue';
import { defineComponent } from 'vue';
export default defineComponent({
name: 'Home',
components: {
IonContent,
IonHeader,
IonPage,
IonTitle,
IonCheckbox,
IonToolbar
},
methods: {
test: ($e: any) => {
console.log('test', $e)
}
}
});
</script>
And I have this error in Chrome :
Failed to execute ‘setAttribute’ on ‘Element’: ‘(ionChange)’ is not a valid attribute name.
I don’t understand, I tried with ionChange, @change, @update, nothing is working. I tried also with or it doesn’t change anything.
That seems very basic, if someone can help me.