Enter the following in the terminal:
- Create project file demo01 vue create demo01
- Vue3 is selected by default
- cd Go to the project file directory cd demo01
- Add ElementUI vue add element
- 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: