How to use SASS / SCSS with latest vue-cli starter project?

前端 未结 3 1162
忘掉有多难
忘掉有多难 2020-12-07 19:16

I need to use SASS or SCSS in my project.

I used the vue-cli to make the latest version of a starter project.

Anyone had any success in making sass/scss work

3条回答
  •  情歌与酒
    2020-12-07 19:35

    1. you install the necessary dependencies

      npm install -D node-sass sass-loader

    2. for global styles, simply import the file into main.js:

      import './styles/my-styles.scss'

    3. in .vue files, add the lang to the