代码:
以下是在旧版本中可行的导入方式,但是在最新版本会报找不到模块的错误
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"