Just starting out with Vue and following tutorials to learn. I've created a component called Header.vue and attempted to import it into App.vue. This is the setup: code structure
Here is App.vue:
<template>
<Header />
</template>
<script>
import Header from "./components/Header.vue";
export default {
setup() {
return {
Header,
};
},
};
</script>
<style>
* {
margin: 0;
padding: 0;
box-sizing: border-box;
font-family: "Fira Sans", sans-serif;
}
body {
background: #eee;
}
</style>
Now, let's take a look at the Header.vue component:
<template>
<div>
<h1>Income Tracker</h1>
<div class="total-income">$0</div>
</div>
</template>
<script>
export default {
};
</script>
<style scoped>
header {
display: flex;
justify-content: space-between;
align-items: center;
padding: 15px 30px;
background-color: #313131;
border-bottom: 5px solid #ffce00;
}
header h1 {
color: #eee;
font-size: 28px;
}
header .total-income {
font-family: "Fira Code", "Fira Sans", sans-serif;
background-color: #ffce00;
color: #fff;
font-size: 20px;
font-weight: 900;
padding: 5px 10px;
min-width: 100px;
text-align: center;
border-radius: 8px;
box-shadow: inset 0px 0px 6px rgba(0, 0, 0, 0.25);
text-shadow: 0px 3px 3px rgba(0, 0, 0, 0.25);
}
</style>
The issue I'm facing is that the styling from App.vue is being applied, but the component isn't resolving. The console shows this error message: error message
I've tried searching on Stack Overflow and Google based on the error message, but I might not be searching correctly or lack enough experience to spot the problem. Any guidance on how to resolve this would be highly appreciated.