mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-11-09 16:16:41 +08:00
docs(vue): update component usage examples for vue 3 (#22050)
This commit is contained in:
@ -516,6 +516,15 @@ export class SelectOptionExample {
|
||||
</ion-select>
|
||||
</ion-item>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { IonItem, IonLabel, IonSelect, IonSelectOption } from '@ionic/vue';
|
||||
import { defineComponent } from 'vue';
|
||||
|
||||
export default defineComponent({
|
||||
components: { IonItem, IonLabel, IonSelect, IonSelectOption }
|
||||
});
|
||||
</script>
|
||||
```
|
||||
|
||||
### Customizing Options
|
||||
@ -563,16 +572,20 @@ export class SelectOptionExample {
|
||||
</ion-item>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { IonItem, IonLabel, IonSelect, IonSelectOption } from '@ionic/vue';
|
||||
import { defineComponent } from 'vue';
|
||||
|
||||
<script lang="ts">
|
||||
import { Component, Vue } from 'vue-property-decorator';
|
||||
|
||||
@Component()
|
||||
export default class Example extends Vue {
|
||||
options: any = {
|
||||
export default defineComponent({
|
||||
components: { IonItem, IonLabel, IonSelect, IonSelectOption },
|
||||
setup() {
|
||||
const options: any = {
|
||||
cssClass: 'my-custom-interface'
|
||||
};
|
||||
|
||||
return { options }
|
||||
}
|
||||
});
|
||||
</script>
|
||||
```
|
||||
|
||||
@ -630,15 +643,20 @@ To customize an individual option, set a class on the `ion-select-option`:
|
||||
</ion-item>
|
||||
</template>
|
||||
|
||||
<script lang="ts">
|
||||
import { Component, Vue } from 'vue-property-decorator';
|
||||
<script>
|
||||
import { IonItem, IonLabel, IonSelect, IonSelectOption } from '@ionic/vue';
|
||||
import { defineComponent } from 'vue';
|
||||
|
||||
@Component()
|
||||
export default class Example extends Vue {
|
||||
options: any = {
|
||||
export default defineComponent({
|
||||
components: { IonItem, IonLabel, IonSelect, IonSelectOption },
|
||||
setup() {
|
||||
const options: any = {
|
||||
cssClass: 'my-custom-interface'
|
||||
};
|
||||
|
||||
return { options }
|
||||
}
|
||||
});
|
||||
</script>
|
||||
```
|
||||
|
||||
|
||||
@ -10,6 +10,15 @@
|
||||
</ion-select>
|
||||
</ion-item>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { IonItem, IonLabel, IonSelect, IonSelectOption } from '@ionic/vue';
|
||||
import { defineComponent } from 'vue';
|
||||
|
||||
export default defineComponent({
|
||||
components: { IonItem, IonLabel, IonSelect, IonSelectOption }
|
||||
});
|
||||
</script>
|
||||
```
|
||||
|
||||
### Customizing Options
|
||||
@ -57,16 +66,20 @@
|
||||
</ion-item>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { IonItem, IonLabel, IonSelect, IonSelectOption } from '@ionic/vue';
|
||||
import { defineComponent } from 'vue';
|
||||
|
||||
<script lang="ts">
|
||||
import { Component, Vue } from 'vue-property-decorator';
|
||||
|
||||
@Component()
|
||||
export default class Example extends Vue {
|
||||
options: any = {
|
||||
export default defineComponent({
|
||||
components: { IonItem, IonLabel, IonSelect, IonSelectOption },
|
||||
setup() {
|
||||
const options: any = {
|
||||
cssClass: 'my-custom-interface'
|
||||
};
|
||||
|
||||
return { options }
|
||||
}
|
||||
});
|
||||
</script>
|
||||
```
|
||||
|
||||
@ -124,15 +137,20 @@ To customize an individual option, set a class on the `ion-select-option`:
|
||||
</ion-item>
|
||||
</template>
|
||||
|
||||
<script lang="ts">
|
||||
import { Component, Vue } from 'vue-property-decorator';
|
||||
<script>
|
||||
import { IonItem, IonLabel, IonSelect, IonSelectOption } from '@ionic/vue';
|
||||
import { defineComponent } from 'vue';
|
||||
|
||||
@Component()
|
||||
export default class Example extends Vue {
|
||||
options: any = {
|
||||
export default defineComponent({
|
||||
components: { IonItem, IonLabel, IonSelect, IonSelectOption },
|
||||
setup() {
|
||||
const options: any = {
|
||||
cssClass: 'my-custom-interface'
|
||||
};
|
||||
|
||||
return { options }
|
||||
}
|
||||
});
|
||||
</script>
|
||||
```
|
||||
|
||||
|
||||
Reference in New Issue
Block a user