element plus detailed installation tutorial

The first time I installed element plus, I stepped on a lot of pitfalls

Note: element plus is only applicable to Vue3 framework!

If you use the Vue2 framework, the first step is to execute

$ npm install element-plus --save

OK, no error reported,

Continue to the second step, importing

import ElementPlus from 'element-plus'
import 'element-plus/dist/index.css'

The following will appear in the terminal:

After checking the information, I found that only the vue3 framework can be used.

step one:

$ npm install element-plus --save

Step 2: Introduce in main.js

import ElementPlus from 'element-plus'
import 'element-plus/dist/index.css'
app.use(ElementPlus)

 As follows:

Finally executed successfully

Guess you like

Origin blog.csdn.net/weixin_44126032/article/details/123822072