一、基本使用
HbuilderX
二、坑以及解决方案、
错误1.Module build failed: Error: Node Sass version 6.0.0 is incompatible with ^4.0.0.
原因:sass版本过高
解决:卸载原来的sass重装低版本sass。
方法:1、卸载: npm uninstall node-sass
2、安装: npm install node-sass@4.14.1
3、运行:npm run dev
错误2.scss语法错误 scss定义样式不需要";"
错误写法`$color:(
‘primary’:’#1a73e8’,
‘black’:black,
‘white’:white,
‘gray1’:’#fafafa’,
‘gray2’:rgba(26,26,26,0.5);//错误点:这里不应该有分号
)`
正确写法`$color:(
‘primary’:’#1a73e8’,
‘black’:black,
‘white’:white,
‘gray1’:’#fafafa’,
‘gray2’:rgba(26,26,26,0.5)
);`