Vue.js Import A Component

When an app gets bigger, we’ll need to split the code into child components for reusability purposes.

Let’s see how to import a Child Component to a Parent Component with 3 simple steps.

Let’s say you have a folder structure like this:

/src
/pages (parent)
ContactsApp.vue
/components (child)
AddContactForm.vue
ShowContactsList.vue

STEP 01: First, Import the Child Component into the Parent Component inside script tag but above export default function declaration.