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:
@@ -719,7 +719,7 @@ export class SkeletonTextExample {
|
||||
</ion-label>
|
||||
</ion-item>
|
||||
<ion-item>
|
||||
<ion-icon name="call" slot="start"></ion-icon>
|
||||
<ion-icon :icon="call" slot="start"></ion-icon>
|
||||
<ion-label>
|
||||
<h3>
|
||||
{{ data.heading }}
|
||||
@@ -812,23 +812,45 @@ export class SkeletonTextExample {
|
||||
}
|
||||
</style>
|
||||
|
||||
<script lang="ts">
|
||||
import { Component, Vue } from 'vue-property-decorator';
|
||||
<script>
|
||||
import {
|
||||
IonAvatar,
|
||||
IonIcon,
|
||||
IonItem,
|
||||
IonLabel,
|
||||
IonList,
|
||||
IonListheader,
|
||||
IonSkeletonText,
|
||||
IonThumbnail
|
||||
} from '@ionic/vue';
|
||||
import { call } from 'ionicons/icons';
|
||||
import { defineComponent } from 'vue';
|
||||
|
||||
@Component()
|
||||
export default class Example extends Vue {
|
||||
data: any;
|
||||
|
||||
mounted() {
|
||||
setTimeout(() => {
|
||||
this.data = {
|
||||
'heading': 'Normal text',
|
||||
'para1': 'Lorem ipsum dolor sit amet, consectetur',
|
||||
'para2': 'adipiscing elit.'
|
||||
};
|
||||
}, 5000);
|
||||
}
|
||||
export default defineComponent({
|
||||
components: {
|
||||
IonAvatar,
|
||||
IonIcon,
|
||||
IonItem,
|
||||
IonLabel,
|
||||
IonList,
|
||||
IonListheader,
|
||||
IonSkeletonText,
|
||||
IonThumbnail
|
||||
},
|
||||
setup() {
|
||||
const data = ref();
|
||||
|
||||
setTimeout(() => {
|
||||
data.value = {
|
||||
'heading': 'Normal text',
|
||||
'para1': 'Lorem ipsum dolor sit amet, consectetur',
|
||||
'para2': 'adipiscing elit.'
|
||||
};
|
||||
}, 5000);
|
||||
|
||||
return { data }
|
||||
}
|
||||
});
|
||||
</script>
|
||||
```
|
||||
|
||||
|
||||
@@ -45,7 +45,7 @@
|
||||
</ion-label>
|
||||
</ion-item>
|
||||
<ion-item>
|
||||
<ion-icon name="call" slot="start"></ion-icon>
|
||||
<ion-icon :icon="call" slot="start"></ion-icon>
|
||||
<ion-label>
|
||||
<h3>
|
||||
{{ data.heading }}
|
||||
@@ -138,22 +138,44 @@
|
||||
}
|
||||
</style>
|
||||
|
||||
<script lang="ts">
|
||||
import { Component, Vue } from 'vue-property-decorator';
|
||||
<script>
|
||||
import {
|
||||
IonAvatar,
|
||||
IonIcon,
|
||||
IonItem,
|
||||
IonLabel,
|
||||
IonList,
|
||||
IonListheader,
|
||||
IonSkeletonText,
|
||||
IonThumbnail
|
||||
} from '@ionic/vue';
|
||||
import { call } from 'ionicons/icons';
|
||||
import { defineComponent } from 'vue';
|
||||
|
||||
@Component()
|
||||
export default class Example extends Vue {
|
||||
data: any;
|
||||
|
||||
mounted() {
|
||||
setTimeout(() => {
|
||||
this.data = {
|
||||
'heading': 'Normal text',
|
||||
'para1': 'Lorem ipsum dolor sit amet, consectetur',
|
||||
'para2': 'adipiscing elit.'
|
||||
};
|
||||
}, 5000);
|
||||
}
|
||||
export default defineComponent({
|
||||
components: {
|
||||
IonAvatar,
|
||||
IonIcon,
|
||||
IonItem,
|
||||
IonLabel,
|
||||
IonList,
|
||||
IonListheader,
|
||||
IonSkeletonText,
|
||||
IonThumbnail
|
||||
},
|
||||
setup() {
|
||||
const data = ref();
|
||||
|
||||
setTimeout(() => {
|
||||
data.value = {
|
||||
'heading': 'Normal text',
|
||||
'para1': 'Lorem ipsum dolor sit amet, consectetur',
|
||||
'para2': 'adipiscing elit.'
|
||||
};
|
||||
}, 5000);
|
||||
|
||||
return { data }
|
||||
}
|
||||
});
|
||||
</script>
|
||||
```
|
||||
Reference in New Issue
Block a user