Home  >  Article  >  Web Front-end  >  How to use vue-cli to import Element UI components

How to use vue-cli to import Element UI components

php中世界最好的语言
php中世界最好的语言Original
2018-05-29 11:13:233454browse

This time I will show you how to use vue-cli to import Element UI components. What are the precautions when using vue-cli to import Element UI components? Here are practical cases, let’s take a look.

First step, now enter npm i element-ui in the command line, such as:

and then in main.js Add

import ElementUI from 'element-ui'
import 'element-ui/lib/theme-chalk/index.css'
Vue.use(ElementUI)

such as:=>

Finally enter npm run dev on the command line to open the project you created. Using

, I believe you have mastered the method after reading the case in this article. For more exciting information, please pay attention to other related articles on the php Chinese website!

Recommended reading

How to use AngularJS custom filter usage

How to use JS to implement paging printing

The above is the detailed content of How to use vue-cli to import Element UI components. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn