Solve the error: Module not found: Error: 'element-plus/lib/theme-chalk/index.css and Can't resolve...

There are the following two solutions to error reports when using element-plus icons.

Error 1:

Solution: Open the element.js file (the path is src > plugins > element.js)

// 将文件中的两条数据都改了:

import 'element-plus/lib/theme-chalk/index.css'

import locale from 'element-plus/lib/locale/lang/zh-cn'

// 改为:

import 'element-plus/theme-chalk/index.css'  // 直接将该条的 lib 去除即可,否则会报错

import locale from 'element-plus/es/locale/lang/zh-cn'  // 将 lib 换成 es

When the following error is reported

Solution: Open element.js file

 in the file

import 'element-plus/es/theme-chalk/index.css'

Change to

import 'element-plus/theme-chalk/index.css'

Guess you like

Origin blog.csdn.net/m0_63689815/article/details/132893572