前面已使用vue-cli新建了一个vue项目,参考 使用命令行创建一个vue项目的全部命令及结果
首先看下新建项目的页面和代码,有部分修改,可忽视,如下图:
然后我们在页面添加sass的代码:
修改完保存后立即就报错了:
在使用scss之前,我们首先需要安装相关的插件: 这里参考的是:链接( vue 项目 使用sass )
$ npm install node-sass --save-dev
> node-sass@4.9.0 install F:\05 poverty alleviation project\poverty\node_modules\node-sass
> node scripts/install.js
Cached binary found at D:\nodejs\node_cache\node-sass\4.9.0\win32-x64-57_binding.node
> node-sass@4.9.0 postinstall F:\05 poverty alleviation project\poverty\node_modules\node-sass
> node scripts/build.js
Binary found at F: