element-ui

安装: npm i element-ui -S

/* main.js */
import ElementUI from 'element-ui';
import 'element-ui/lib/theme-chalk/index.css';
Vue.use(ElementUI);

sass

  1. 安装指定版本: npm install sass-loader --save-dev
  2. 安装node-sass(指定版本): npm i -D node-sass@4.12.0

sass-loade卸载: npm uninstall sass-loade

如果报错:
gyp verb check python checking for Python executable "python2" in the PATH
gyp verb check python checking for Python executable "python" in the PATH

主要是windows平台缺少编译环境

  1. 先运行: npm install -g node-gyp
  2. 然后运行:运行 npm install --global --production windows-build-tools 可以自动安装跨平台的编译器:gym
    还是报错 就看看版本是不是对应的上

image.png

image.png

安装指定版本
npm i -D node-sass@4.12.0
npm i -D sass-loader@7.1.0

安装后使用要在build/webpack.base.conf.jsde里的在module的rules中插入以下代码添加配置:

{
test: /\.scss$/,
loaders: ["style", "css", "sass"]
},

image.png

最后重新运行


Tong_sunshine
62 声望10 粉丝

看看看! 再看把你眼珠子抠掉!


下一篇 »
Vue 题---记录