How to install Element UI and use vector graphics in vue3.0

How to install Element UI and use vector graphics in vue3.0
  • Here we only focus on the installation and use of v3. If you want to learn about v2, you can move to its official website: https://element.eleme.io/#/zh-CN/component/installation
  • v3 official website: https://element-plus.org/zh-CN/guide/installation.html
  • Difference between vue2 and vue3 when using element ui
  • Installation Commands
The files introduced in main.js are different
When using the icon, v2 does not need to be installed, but v3 needs to be installed
There are differences in the way icons are written in vue files between v2 and v3

Icons in v2 use fonts, while icons in v3 use svg

Install Element UI

  • Install using npm

npm install element-plus --save

Icon icon needs to be installed

npm install @element-plus/icons-vue

  • use

Globally transfer to main.js

import elementPlus from 'element-plus'
import 'element-plus/dist/index.css'
import '@/assets/css/index.scss'
//Introduce external vector graphics import '@/assets/iconfont/iconfont.css'
const app = createApp(App);
app.config.globalProperties.axios = axios;
app
.use(elementPlus)
.mount('#app');

Write the code normally according to the label writing method specified in Element UI

vue file uses icon icon

<el-icon :size="size" :color="color"> <edit></edit> </el-icon>
or <edit></edit>
<add-location/>
//Vector illustration<i class="iconfont icon-huyan"></i>
//Introduce the icon (svg) you need to use
import {Edit,AddLocation} from '@element-plus/icons-vue'
components:{ Edit, AddLocation }

Introducing vector graphics into your project

download

  • use

Copy these six files into the project and import them into main.js before using them

This is the end of this article about installing Element UI in vue3.0 and using vector graphics. For more relevant content about installing Element UI in vue3.0, please search for previous articles on 123WORDPRESS.COM or continue to browse the related articles below. I hope you will support 123WORDPRESS.COM in the future!

You may also be interested in:
  • Vue+ElementUI implements paging function-mysql data
  • Vue+elementui realizes multiple selection and search functions of drop-down table
  • Vue Element-ui implements tree control node adding icon detailed explanation
  • Use vue2+elementui for hover prompts
  • Detailed explanation of the use of ElementUI in Vue

<<:  Steps to deploy ingress-nginx on k8s

>>:  The table table uses: nth-child() to achieve alternate color change and alignment

Recommend

Two ways to declare private variables in JavaScript

Preface JavaScript is not like other languages ​​...

HTML mouse css control

Generally speaking, the mouse is displayed as an u...

Analysis of MySQL's planned tasks and event scheduling examples

This article uses examples to describe MySQL'...

Echarts Basic Introduction: General Configuration of Bar Chart and Line Chart

1Basic steps of echarts Four Steps 1 Find the DOM...

Use dockercompose to build springboot-mysql-nginx application

In the previous article, we used Docker to build ...

Detailed explanation of Linux dynamic library generation and usage guide

The file name of the dynamic library file under L...

Pure CSS3 to achieve mouse over button animation Part 2

After the previous two chapters, do you have a ne...

Flash embedded in web pages and IE, FF, Maxthon compatibility issues

After going through a lot of hardships, I searched...

The difference between animation and transition

The difference between CSS3 animation and JS anim...

MySQL 8.0.25 installation and configuration tutorial under Linux

The latest tutorial for installing MySQL 8.0.25 o...

How to create a swap partition file in Linux

Introduction to Swap Swap (i.e. swap partition) i...

Linux service monitoring and operation and maintenance

Table of contents 1. Install the psutil package S...

A detailed discussion of evaluation strategies in JavaScript

Table of contents A chestnut to cover it Paramete...

Vue event's $event parameter = event value case

template <el-table :data="dataList"&...