Import Ionic components globally with @ionic/vue (beta) vue 3

The docs suggests the below implementation

<script>
import { IonContent, IonHeader, IonPage, IonTitle, IonToolbar, } from '@ionic/vue';
export default {
  name: 'HomePage',
  components: {
    IonContent,
    IonHeader,
    IonPage,
    IonTitle,
    IonToolbar,
  },
};
</script>

But that will become a little too much down the line…

How do I import these components globally with the new @ionic/vue beta (vue 3)?

I mean , with vue 2 vue.use(Ionic) in main was enough instead of every single components… how do I achieve it with the new beta?

1 Like

If I’m not mistaken, the answer is: you don’t.

I think part of the reason for forcing you to import only the components you are using is it results in a smaller bundle, because the bundler will only include the components you actually use.