- Install ElementUI using the NPM command
npm i element-ui -S
Copy the code
After installation, an element-UI folder will appear in the node_modules folder in the directory.
- in
main.js
File import
// Introduce element UI
import ElementUI from 'element-ui'
// Introduce element's theme file
import 'element-ui/lib/theme-chalk/index.css'
// Register Element as a Vue plug-in
Vue.use(ElementUI)
Copy the code
- test
You can copy some code from Element’s official website into app.vue and see if it displays correctly