mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-11-10 00:27:41 +08:00
docs(vue): update component usage examples for vue 3 (#22050)
This commit is contained in:
@ -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>
|
||||
```
|
||||
|
||||
|
||||
@ -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>
|
||||
```
|
||||
|
||||
Reference in New Issue
Block a user