(一)element框架(element-ui,emelemt-plus)安装和引用

(一):vue2.6以下使用elemtnt-ui:

1:安装命令

yarn add element-ui --save

2:删除

yarn remove element-ui --save

安装如果出现下面问题:

error Couldn't find package "fsevents@~2.3.2" required by "chokidar@^3.5.3" on the "npm" registry.

解决方法:

找到package.json,移除  "dependencies": {}  节点

然后:yarn install=>yarn add element-ui,然后会重新生成"dependencies": {} 节点=>然后刚刚移除的内容拷贝到"dependencies": {} 节点下面

=>然后yarn install去还原拷贝到dependencies": {} 下的呢些组件,最后yarn run serve就可以了

=>如果yarn add element-ui报下面的错

error An unexpected error occurred: "https://registry.yarnpkg.com/element-ui: connect ETIMEDOUT 104.16.16.35:443".
info If you think this is a bug, please open a bug report with the information provided in "E:\\vscode\\vue\\vue\\vue\\vue\\webapiroots3diyipian\\yarn-error.log".
info Visit https://yarnpkg.com/en/docs/cli/add for documentation about this command.

就重复上面的操作

3:在main.js引用element

import ElementUI from 'element-ui';

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

Vue.use(ElementUI);

 

(二):vue3.x使用entment-ui

1:安装elemtnt-plus:

yarn add element-plus

2:引用element-plus

import ElementPlus from 'element-plus';
import 'element-plus/dist/index.css';
const app=createApp(App);
app.use(ElementPlus)
 
注意:
element框架区别 Element-ui适用于Vue2框架 Element-plus适用于Vue3框架
posted @   yingxianqi  阅读(2652)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· 阿里最新开源QwQ-32B,效果媲美deepseek-r1满血版,部署成本又又又降低了!
· 单线程的Redis速度为什么快?
· SQL Server 2025 AI相关能力初探
· AI编程工具终极对决:字节Trae VS Cursor,谁才是开发者新宠?
· 展开说说关于C#中ORM框架的用法!
点击右上角即可分享
微信分享提示