1.安装依赖

npm install element-ui --save

2.引入element-ui

在main.js中引入下面代码

import ElementUI from 'element-ui';
import 'element-ui/lib/theme-chalk/index.css';

Vue.use(ElementUI);

报错问题:

问题1.

Errors:
  25  http://eslint.org/docs/rules/no-tabs
   7  http://eslint.org/docs/rules/indent
   7  http://eslint.org/docs/rules/semi
   2  http://eslint.org/docs/rules/no-undef
   1  http://eslint.org/docs/rules/eol-last
   1  http://eslint.org/docs/rules/no-new
   1  http://eslint.org/docs/rules/no-multiple-empty-lines

You may use special comments to disable some warnings.
Use // eslint-disable-next-line to ignore the next line.
Use /* eslint-disable */ to ignore all warnings in a file.

解决办法:

问题2、 css的文件路径报错

解决方法:

因为原版的css文件是theme-default,改版后就变为theme-chalk,在安装目录下将文件名改为theme-chalk即可,文件路径:node_modules/element-ui/lib/theme-chalk/index.css

 

Logo

前往低代码交流专区

更多推荐