Quantcast
Channel: Ionic Framework - Ionic Forum
Viewing all articles
Browse latest Browse all 49083

Why is it necessary to import Ionic components?

$
0
0

Looking at Quasar, Vuetify, and Nuxt, Ionic is the only framework that requires you to import the tags/components that you are going to use in a view. Why is that, and is there a way of auto-importing the components like other frameworks do? The Ionic way requires quite a lot of additional typing. When you add or remove tags in your view, you have to remember to add/remove them in three places (!) in your view: In the template, in the import, and in the components line. That makes the whole thing a bit inflexible. Here’s an example:

Ionic:

<template>
  <ion-button>Yes</ion-button>
</template>

<script>
import { IonButton } from '@ionic/vue';

export default {
  components: {
    IonButton
  }
});
</script>

Vuetify:

<template>
  <v-btn>Yes</v-btn>
</template>

1 post - 1 participant

Read full topic


Viewing all articles
Browse latest Browse all 49083

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>