[Vuejs]-How to import the file that suffix is ‘.scss’ into a sub component of Vue project?

0👍

Can i know file structure of your project?

  1. check your loader is right work;

  2. may be you can try “relative path” of the sub component file.

eg. @import "../../assets/scss/global_css";

0👍

If your file structure like this

assets
   scss
     global_css.scss 
components
   sub_components
     s_c.vue

You should write
@import "../../assets/scss/global_css" in s_c.vue to import global_css.scss.

More information see this.

Leave a comment