docs(vue): update component usage examples for vue 3 (#22050)

This commit is contained in:
Liam DeBeasi
2020-09-11 13:48:21 -04:00
committed by GitHub
parent 74af3cb50b
commit db2cac20fb
118 changed files with 2659 additions and 556 deletions

View File

@ -280,16 +280,18 @@ export class ActionSheetExample {
```html
<template>
<IonVuePage :title="'Action Sheet'">
<ion-button @click="presentActionSheet">Show Action Sheet</ion-button>
</IonVuePage>
<ion-button @click="presentActionSheet">Show Action Sheet</ion-button>
</template>
<script>
export default {
import { IonButton, actionSheetController } from '@ionic/vue';
import { defineComponent } from 'vue';
export default defineComponent({
components: { IonButton },
methods: {
presentActionSheet() {
return this.$ionic.actionSheetController
async presentActionSheet() {
const actionSheet = await actionSheetController
.create({
header: 'Albums',
cssClass: 'my-custom-class',
@ -332,11 +334,11 @@ export default {
},
},
],
})
.then(a => a.present())
});
return actionSheet.present();
},
},
}
});
</script>
```

View File

@ -1,15 +1,17 @@
```html
<template>
<IonVuePage :title="'Action Sheet'">
<ion-button @click="presentActionSheet">Show Action Sheet</ion-button>
</IonVuePage>
<ion-button @click="presentActionSheet">Show Action Sheet</ion-button>
</template>
<script>
export default {
import { IonButton, actionSheetController } from '@ionic/vue';
import { defineComponent } from 'vue';
export default defineComponent({
components: { IonButton },
methods: {
presentActionSheet() {
return this.$ionic.actionSheetController
async presentActionSheet() {
const actionSheet = await actionSheetController
.create({
header: 'Albums',
cssClass: 'my-custom-class',
@ -52,10 +54,10 @@ export default {
},
},
],
})
.then(a => a.present())
});
return actionSheet.present();
},
},
}
});
</script>
```