Vue.js Import A Component

Raja Tamil
1 min readSep 20, 2021

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.

--

--

Raja Tamil

👇click the link and get 80% OFF on the premium web development courses (HTML5, CSS3, JavaScript ES6, Vue JS 3 & Firebase 10 https://softauthor.com