Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

215
Views
Vue 3 components not importing other vue components

My Vue component navbar.vue does not import other components.
This is Vue 3 with the Option API.
All of the components are imported by index.js in the component folder

import navbar from '@/components/navbar.vue'
import btn from '@/components/btn.vue'

export {
  navbar,
  btn
}

This is the navbar.vue:

<template>
  <header class="navbar">
    <ul>
      <li>
        <router-link to="/">Home</router-link>
      </li>
      <li>
        <btn></btn>
      </li>
    </ul>
  </header>
</template>

<script>
import { btn } from '@/components'

export default {
  name: 'navbar',
  components: {
    btn
  }
}
</script>

This is the btn.vue components:

<template>
  <button class="btn" @click="$emit('click')">
    <slot/>
  </button>
</template>

<script>
export default {
  name: 'btn'
}
</script>
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Your index.js exported navbar and btn. And also you have already exported another component from navbar.vue in same file level. So make a separate folder for navbar and btn or change the export name. I am new to frameworks. Hope this will work.

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!