mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2026-03-13 10:22:08 +08:00
docs(vue): update component usage examples for vue 3 (#22050)
This commit is contained in:
@@ -1084,6 +1084,29 @@ export class SelectExample {
|
||||
|
||||
</ion-list>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {
|
||||
IonItem,
|
||||
IonLabel,
|
||||
IonList,
|
||||
IonListHeader,
|
||||
IonSelect,
|
||||
IonSelectOption
|
||||
} from '@ionic/vue';
|
||||
import { defineComponent } from 'vue';
|
||||
|
||||
export default defineComponent({
|
||||
components: {
|
||||
IonItem,
|
||||
IonLabel,
|
||||
IonList,
|
||||
IonListHeader,
|
||||
IonSelect,
|
||||
IonSelectOption
|
||||
}
|
||||
});
|
||||
</script>
|
||||
```
|
||||
|
||||
### Multiple Selection
|
||||
@@ -1124,6 +1147,29 @@ export class SelectExample {
|
||||
</ion-item>
|
||||
</ion-list>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {
|
||||
IonItem,
|
||||
IonLabel,
|
||||
IonList,
|
||||
IonListHeader,
|
||||
IonSelect,
|
||||
IonSelectOption
|
||||
} from '@ionic/vue';
|
||||
import { defineComponent } from 'vue';
|
||||
|
||||
export default defineComponent({
|
||||
components: {
|
||||
IonItem,
|
||||
IonLabel,
|
||||
IonList,
|
||||
IonListHeader,
|
||||
IonSelect,
|
||||
IonSelectOption
|
||||
}
|
||||
});
|
||||
</script>
|
||||
```
|
||||
|
||||
### Interface Options
|
||||
@@ -1177,29 +1223,52 @@ export class SelectExample {
|
||||
</ion-list>
|
||||
</template>
|
||||
|
||||
<script lang="ts">
|
||||
import { Component, Vue } from 'vue-property-decorator';
|
||||
<script>
|
||||
import {
|
||||
IonItem,
|
||||
IonLabel,
|
||||
IonList,
|
||||
IonListHeader,
|
||||
IonSelect,
|
||||
IonSelectOption
|
||||
} from '@ionic/vue';
|
||||
import { defineComponent } from 'vue';
|
||||
|
||||
@Component()
|
||||
export default class Example extends Vue {
|
||||
customAlertOptions: any = {
|
||||
export default defineComponent({
|
||||
components: {
|
||||
IonItem,
|
||||
IonLabel,
|
||||
IonList,
|
||||
IonListHeader,
|
||||
IonSelect,
|
||||
IonSelectOption
|
||||
},
|
||||
setup() {
|
||||
const customAlertOptions: any = {
|
||||
header: 'Pizza Toppings',
|
||||
subHeader: 'Select your toppings',
|
||||
message: '$1.00 per topping',
|
||||
translucent: true
|
||||
};
|
||||
|
||||
customPopoverOptions: any = {
|
||||
const customPopoverOptions: any = {
|
||||
header: 'Hair Color',
|
||||
subHeader: 'Select your hair color',
|
||||
message: 'Only select your dominant hair color'
|
||||
};
|
||||
|
||||
customActionSheetOptions: any = {
|
||||
const customActionSheetOptions: any = {
|
||||
header: 'Colors',
|
||||
subHeader: 'Select your favorite color'
|
||||
};
|
||||
|
||||
return {
|
||||
customAlertOptions,
|
||||
customPopoverOptions,
|
||||
customActionSheetOptions
|
||||
}
|
||||
}
|
||||
});
|
||||
</script>
|
||||
```
|
||||
|
||||
|
||||
@@ -29,6 +29,29 @@
|
||||
|
||||
</ion-list>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {
|
||||
IonItem,
|
||||
IonLabel,
|
||||
IonList,
|
||||
IonListHeader,
|
||||
IonSelect,
|
||||
IonSelectOption
|
||||
} from '@ionic/vue';
|
||||
import { defineComponent } from 'vue';
|
||||
|
||||
export default defineComponent({
|
||||
components: {
|
||||
IonItem,
|
||||
IonLabel,
|
||||
IonList,
|
||||
IonListHeader,
|
||||
IonSelect,
|
||||
IonSelectOption
|
||||
}
|
||||
});
|
||||
</script>
|
||||
```
|
||||
|
||||
### Multiple Selection
|
||||
@@ -69,6 +92,29 @@
|
||||
</ion-item>
|
||||
</ion-list>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {
|
||||
IonItem,
|
||||
IonLabel,
|
||||
IonList,
|
||||
IonListHeader,
|
||||
IonSelect,
|
||||
IonSelectOption
|
||||
} from '@ionic/vue';
|
||||
import { defineComponent } from 'vue';
|
||||
|
||||
export default defineComponent({
|
||||
components: {
|
||||
IonItem,
|
||||
IonLabel,
|
||||
IonList,
|
||||
IonListHeader,
|
||||
IonSelect,
|
||||
IonSelectOption
|
||||
}
|
||||
});
|
||||
</script>
|
||||
```
|
||||
|
||||
### Interface Options
|
||||
@@ -122,28 +168,51 @@
|
||||
</ion-list>
|
||||
</template>
|
||||
|
||||
<script lang="ts">
|
||||
import { Component, Vue } from 'vue-property-decorator';
|
||||
<script>
|
||||
import {
|
||||
IonItem,
|
||||
IonLabel,
|
||||
IonList,
|
||||
IonListHeader,
|
||||
IonSelect,
|
||||
IonSelectOption
|
||||
} from '@ionic/vue';
|
||||
import { defineComponent } from 'vue';
|
||||
|
||||
@Component()
|
||||
export default class Example extends Vue {
|
||||
customAlertOptions: any = {
|
||||
export default defineComponent({
|
||||
components: {
|
||||
IonItem,
|
||||
IonLabel,
|
||||
IonList,
|
||||
IonListHeader,
|
||||
IonSelect,
|
||||
IonSelectOption
|
||||
},
|
||||
setup() {
|
||||
const customAlertOptions: any = {
|
||||
header: 'Pizza Toppings',
|
||||
subHeader: 'Select your toppings',
|
||||
message: '$1.00 per topping',
|
||||
translucent: true
|
||||
};
|
||||
|
||||
customPopoverOptions: any = {
|
||||
const customPopoverOptions: any = {
|
||||
header: 'Hair Color',
|
||||
subHeader: 'Select your hair color',
|
||||
message: 'Only select your dominant hair color'
|
||||
};
|
||||
|
||||
customActionSheetOptions: any = {
|
||||
const customActionSheetOptions: any = {
|
||||
header: 'Colors',
|
||||
subHeader: 'Select your favorite color'
|
||||
};
|
||||
|
||||
return {
|
||||
customAlertOptions,
|
||||
customPopoverOptions,
|
||||
customActionSheetOptions
|
||||
}
|
||||
}
|
||||
});
|
||||
</script>
|
||||
```
|
||||
|
||||
Reference in New Issue
Block a user