安装element ui记录

步骤

1.先在dev控制台输入npm i element-ui --save

2.出现警告

 F:\vue_test\src> npm i element-ui --save

npm WARN deprecated core-js@2.6.12: core-js@<3.23.3 is no longer maintained and not recommended for usage due to the number of issues. Because of the V8 engine whims, feature detection in old core-js versions could cause a slowdown up to 100x even if nothing is polyfilled. Some versions have web compatibility issues. Please, upgrade your dependencies to the

actual version of core-js.

added 9 packages in 18s 

3.原因是英文翻译:npm WARN已弃用core-js@2.6.12: core-js@不再维护,由于问题太多,不建议使用。 由于V8引擎的奇想,旧core-js版本的特性检测可能会导致高达100倍的减速,即使什么都没有填充。 请将你的依赖关系升级到core-js的实际版本。

即需要升级core-js

4.npm i core-js

5.关闭,重新打开

6.在dev窗口执行npm i element-ui --save

7.执行npm run serve,在package.json中出现element ui的版本号  

安装element ui

8.在main.js中输入

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

9.在public/index中输入(这是ui的样式)

<link rel="stylesheet" href="https://unpkg.com/element-ui/lib/theme-chalk/index.css">
声明:本站所有文章,如无特殊说明或标注,均为本站原创发布。任何个人或组织,在未征得本站同意时,禁止复制、盗用、采集、发布本站内容到任何网站、书籍等各类媒体平台。如若本站内容侵犯了原著者的合法权益,可联系我们进行处理。