I'm currently learning Vue and can't get rid of a scope problem.
Question:
The profile.vue styles keep overriding the ones from sidebar.vue. The sidebar should keep it's red background with this setting, while the section in the profile page should be blue. Shouldn't do scoped within the style tag this job?
Profile.vue below:
<template>
<main>
<section>
Test
</section>
<Sidebar></Sidebar>
</main>
</template>
<script>
import Sidebar from "../../components/sidebar/Sidebar";
export default {
name: "Profile",
components: {Sidebar}
}
</script>
<style scoped lang="scss">
main {
width: 100%;
@include flex();
section {
width: 100%;
background: blue;
margin-left: $size*5;
}
}
</style>
Sidebar.vue below:
<template>
<section>
Test
</section>
</template>
<script>
export default {
name: "Sidebar"
}
</script>
<style scoped lang="scss">
section {
max-width: ($size*45);
width: 100%;
background: red;
}
</style>
