在Vue中添加css扩展语言sass

  • npm install vue-loader --save-dev

  • npm install node-sass --save-dev

  • npm install sass-loader --save-dev

  • npm install style-loader --save-dev

  • 安装完上述插件之后,就可以进行引用了

    <style lang="scss" scoped>
      $testColor: #f00;
    </style>

如果源码出现以下错误:则说明sass版本过高,只需要调为较低版本即可。实证有效版本:7.3.1

  • 修改之后删除node_modules文件夹
  • 然后npm install 重新下载
  • npm run dev即可

TypeError: this.getResolve is not a function

猜你喜欢

转载自www.cnblogs.com/serahuli/p/11987178.html