My Vue component navbar.vue
not import other components.
This is Vue 3 whit Option API, somebody can help me?
I’ve all components 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>