vue+ElementUI报错:Cannot read property ‘use‘ of undefined

Enter the following in the terminal:

  1. Create project file demo01  vue create demo01
  2. Vue3 is selected by default 
  3. cd Go to the project file directory  cd demo01
  4. Add ElementUI vue add element
  5. Run the project npm run serve

       

 

 Very good, there is an address here, but the browser is blank when it is opened.

Right-click "Inspect" in the browser and find: 

Search for information, refer to http://t.csdn.cn/pAX3D , and find that Vue2 corresponds to element-ui, and Vue3 corresponds to element-plus. The root cause of the above error is that the vue version does not match elementUI . Here, my VUE version is vue3, and the default element should correspond to vue2. When I change the selection in step 2 to Default ([Vue 2] babel, eslint), no error is reported.

 Dangdang!

References:

http://t.csdn.cn/pAX3D

http://t.csdn.cn/Jf7ou

Guess you like

Origin blog.csdn.net/qq_54727445/article/details/128375751