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

How to use vue-cli to import Element UI components

php中世界最好的语言
Release: 2018-05-29 11:13:23
Original
3505 people have browsed it

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)
Copy after login

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!

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template