安装如下依赖(package.json 未包含):vueelement-plusecharts@element-plus/icons-vue

安装如下依赖(package.json 未包含):

vue

element-plus

echarts

@element-plus/icons-vue


安装指定的依赖(Vue、Element Plus、ECharts 和 Element Plus 图标)

1. 安装 Vue(Vue 3)

复制代码
npm install vue@next

2. 安装 Element Plus 及其图标库

复制代码
npm install element-plus @element-plus/icons-vue

3. 安装 ECharts

复制代码
npm install echarts

完整安装命令(一次性安装所有依赖)

复制代码
npm install vue@next element-plus @element-plus/icons-vue echarts

说明:

  1. Vue 版本
    vue@next 会安装 Vue 3(当前最新稳定版),这是 Element Plus 的运行基础。

  2. 自动保存依赖

    以上命令会将依赖自动写入 package.json(如果文件不存在,首次安装时会自动创建)。

  3. 项目集成示例

    复制代码
    // main.js
    import { createApp } from 'vue'
    import App from './App.vue'
    import ElementPlus from 'element-plus'
    import 'element-plus/dist/index.css'
    import * as Icons from '@element-plus/icons-vue'
    
    const app = createApp(App)
    
    // 注册所有图标
    for (const [name, component] of Object.entries(Icons)) {
      app.component(name, component)
    }
    
    app.use(ElementPlus)
    app.mount('#app')
  4. 验证安装

    检查 package.json 中的 dependencies 是否包含:

    复制代码
    "dependencies": {
      "@element-plus/icons-vue": "^2.x",
      "element-plus": "^2.x",
      "echarts": "^5.x",
      "vue": "^3.x"
    }

注意:实际版本号(x部分)将以安装时的最新稳定版为准。如需指定版本,可在包名后添加 @版本号,例如 element-plus@2.0.1

相关推荐
云水一下2 小时前
从零开始!VMware安装Fedora Workstation 44桌面系统完整教程
前端
小码哥_常3 小时前
安卓黑科技:实现多平台商品详情页一键跳转APP
前端
killerbasd3 小时前
还是迷茫 5.3
前端·react.js·前端框架
不会敲代码14 小时前
TCP/IP 与前端性能:从数据包到首次渲染的底层逻辑
前端·tcp/ip
kyriewen4 小时前
奥特曼借GPT-5.5干杯,而你的Copilot正按Token收钱
前端·github·openai
AC赳赳老秦4 小时前
投标合规提效:用 OpenClaw 实现标书 / 合同自动审核、关键词校验、格式优化,降低废标风险
开发语言·前端·python·eclipse·emacs·deepseek·openclaw
kyriewen4 小时前
代码写成一锅粥?3个设计模式让你的项目“起死回生”
前端·javascript·设计模式
不会敲代码15 小时前
从零搭建 AI 日记助手:用 Milvus 向量数据库实现语义搜索
javascript·openai
千寻girling5 小时前
《 Git 详细教程 》
前端·后端·面试
threelab6 小时前
Three.js UV 图像变换效果 | 三维可视化 / AI 提示词
javascript·人工智能·uv