【vue3.0 引入Element Plus步骤与使用】
vue
vuejs/vue: 是一个用于构建用户界面的 JavaScript 框架,具有简洁的语法和丰富的组件库,可以用于开发单页面应用程序和多页面应用程序。
项目地址:https://gitcode.com/gh_mirrors/vu/vue

·
全局引入Element Plus
Element Plus 是一个基于 Vue 3.0 的 UI 组件库,它是 Element UI 的升级版。Element Plus 的设计理念是简单、易用、高效,具有良好的可定制性和扩展性。下面是使用 Element Plus 的步骤:
1. 安装 Element Plus
可以通过 npm 或者 yarn 安装 Element Plus。
使用 npm 安装:
npm install element-plus --save
使用 yarn 安装:
yarn add element-plus
2. 引入 Element Plus
在 main.js 中引入 Element Plus:
import { createApp } from 'vue'
import App from './App.vue'
import ElementPlus from 'element-plus'
import 'element-plus/dist/index.css'
const app = createApp(App)
app.use(ElementPlus)
app.mount('#app')
3. 使用 Element Plus 组件
在需要使用 Element Plus 组件的地方,直接引入即可使用。例如,在 App.vue 中使用一个 Button 按钮组件:
<template>
<div>
<el-button type="primary">Primary</el-button>
</div>
</template>
以上就是在 Vue 3.0 中引入和使用 Element Plus 的步骤。




vuejs/vue: 是一个用于构建用户界面的 JavaScript 框架,具有简洁的语法和丰富的组件库,可以用于开发单页面应用程序和多页面应用程序。
最近提交(Master分支:1 天前 )
9e887079
[skip ci] 10 个月前
73486cb5
* chore: fix link broken
Signed-off-by: snoppy <michaleli@foxmail.com>
* Update packages/template-compiler/README.md [skip ci]
---------
Signed-off-by: snoppy <michaleli@foxmail.com>
Co-authored-by: Eduardo San Martin Morote <posva@users.noreply.github.com> 1 年前
更多推荐
所有评论(0)