Preface
Install in the project you just started usingvue3
+vite
+ , using the component does not work, the error is as follows:ts
element-plus
UnCaugh SyntaxError:The requested module '/node_modules/element-plus/lib/locale/lang/zh-cn.js?v=7.0.2' does not provide an export named 'default'
solution
Removal
node_modules
Removal of textpackage-lock.json
Removal of textRevise
package.json
Revised
Vue
Version, issue required3.3.2
or moreInstall
element-plus
, re-npm install i --force
, force installation, otherwise an error will be reported
element-plus cannot find style
Inmain.js
, find the imported element-plus
style
The solution is also very simple. Since you have installedelement-plus
the dependency but cannot find the file, it is most likely that the path has changed. So I flipped through it manuallynode-modules
and found that the entiretheme-chalk
folder had been moved
Old version installation location
import 'element-plus/lib/theme-chalk/index.css'; // 这里巨坑,路径问题
New version installation location
import 'element-plus/dist/index.css';
If a style problem is found, it is most likely a problem with the location where the style is introduced.
Summarize
element-plus
The use is not much different fromElementUI
, but there are some pitfalls that need to be avoided
Front-end and back-end development interface joint debugging and docking parameters
Fill out questionnaires and earn bonuses
Implementing 3D panoramic room viewing in Vue
The old lady, aunt and harvester scholar were banned
Let’s talk about sauce latte, Ruixing and Moutai join forces
Implement automatic rotation of 3D ball in Vue
How to implement a 3D city distribution map in Vue
(Able to draw and answer questions)