新版本element-plus导入时错误:These dependencies were not found

在升级到element-plus新版本后,遇到依赖未找到的问题。旧的导入方式不再适用,通过官网找到正确的模块路径解决了问题。然而,按需引入CSS未生效,需引入完整index.css。国际化组件导入方式也需更新为新版。
摘要由CSDN通过智能技术生成

代码:

以下是在旧版本中可行的导入方式,但是在最新版本会报找不到模块的错误

import "element-plus/src/theme-chalk/base.css"
import {
    ElButton } from "element-plus/lib"

错误:

These dependencies were not found:

* element-plus/lib/el-button in ./src/global/register-element.ts
* element-plus/theme-chalk/src in ./src/global/register-element.ts

解决:

在官网找到的正确路径如下:

// 导入index.css
import "element-plus/dist/index.css"
  • 8
    点赞
  • 9
    收藏
    觉得还不错? 一键收藏
  • 3
    评论
评论 3
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值