In my project, I used the Vue CLI web package and here is a solution that worked for me.
I manage all my SCSS in the App.vue file. In each of Component.vue I settled on using <style></style> and started creating a separate component.scss .
So my src folder looks like this:
/src /assets /components /compA CompA.vue compA.scss /compB CompB.vue compB.scss App.vue main.js
And my App.vue looks like
<template> ... </template> <script> ... </script> <style lang="less"> //Bootstrap @import "../node_modules/bootstrap-sass/assets/stylesheets/bootstrap"; //Components @import "components/compA.scss"; @import "components/compB.scss"; </style>
The advantage of this setting is to manage all your styles in one place, as well as being able to use all your boot variables and mixins.
I have followed this route since I imported Boostrap SCSS into all my components, the size of my application continued to grow. The increase is not significant if I import only the variables, but when I import the entire SCSS Boostrap, the increase becomes significant. I do this, so I can use mixins and extend some existing styles.
source share