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:
@@ -1,16 +1,29 @@
|
||||
```html
|
||||
<template>
|
||||
<!-- uses "star" icon for both modes -->
|
||||
<ion-icon name="star"></ion-icon>
|
||||
<ion-icon :icon="star"></ion-icon>
|
||||
|
||||
<!-- explicitly set the icon for each mode -->
|
||||
<ion-icon ios="home" md="star"></ion-icon>
|
||||
<ion-icon :ios="home" :md="star"></ion-icon>
|
||||
|
||||
<!-- use a custom svg icon -->
|
||||
<ion-icon src="/path/to/external/file.svg"></ion-icon>
|
||||
|
||||
<!-- set the icon size -->
|
||||
<ion-icon size="small" name="heart"></ion-icon>
|
||||
<ion-icon size="large" name="heart"></ion-icon>
|
||||
<ion-icon size="small" :icon="heart"></ion-icon>
|
||||
<ion-icon size="large" :icon="heart"></ion-icon>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { IonIcon } from '@ionic/vue';
|
||||
import { heart, home, star } from 'ionicons/icons';
|
||||
import { defineComponent } from 'vue';
|
||||
|
||||
export default defineComponent({
|
||||
components: { IonIcon },
|
||||
setup() {
|
||||
return { heart, home, star }
|
||||
}
|
||||
});
|
||||
</script>
|
||||
```
|
||||
|
||||
Reference in New Issue
Block a user