Detailed explanation of how to use element-plus in Vue3

Detailed explanation of how to use element-plus in Vue3

Vue3 has been out for a while, and element has also updated its version to be compatible with vue3. Here is a brief introduction on how to use element-plus

1. Installation

npm install element-plus --save

2. Import in main.js

import { createApp, Vue } from 'vue';
import ElementPlus from 'element-plus';
import 'element-plus/dist/index.css';
import App from './App.vue';

const app = createApp(App)
app.use(ElementPlus)
app.mount('#app')

3. Use

Here we use the button

<el-row>
  <el-button>Default button</el-button>
  <el-button type="primary">Primary button</el-button>
  <el-button type="success">Success button</el-button>
  <el-button type="info">Information button</el-button>
  <el-button type="warning">Warning button</el-button>
  <el-button type="danger">Danger button</el-button>
</el-row>

For details, please refer to the official documentation

This is the end of this article about how to use element-plus in Vue3. For more information about how to use element-plus in Vue3, please search for previous articles on 123WORDPRESS.COM or continue to browse the following related articles. I hope you will support 123WORDPRESS.COM in the future!

You may also be interested in:
  • Two examples of using icons in Vue3
  • Detailed explanation of the process of using Icon icons globally in element-plus in Vue3

<<:  A brief analysis of the function calling process under the ARM architecture

>>:  The magic of tbody tag speeds up the display of table content

Recommend

Detailed explanation of Vue configuration request multiple server solutions

1. Solution 1.1 Describing the interface context-...

Getting started with JavaScript basics

Table of contents 1. Where to write JavaScript 2....

CSS3 implementation example of rotating only the background image 180 degrees

1. Mental Journey When I was writing the cockpit ...

Detailed explanation of the difference between tinyint and int in MySQL

Question: What is the difference between int(1) a...

Implementation code of front-end HTML skin changing function

50 lines of code to change 5 skin colors, includi...

How MLSQL Stack makes stream debugging easier

Preface A classmate is investigating MLSQL Stack&...

Build a file management system step by step with nginx+FastDFS

Table of contents 1. Introduction to FastDFS 1. I...

The forgotten button tag

Note: This article has been translated by someone ...

Example of using CSS filter to write mouse over effect

Use CSS filter to write mouse over effect <div...

Element Timeline implementation

Table of contents Components - Timeline Custom no...

Linux Network System Introduction

Table of contents Network Information Modify the ...