# Vue3 + Element Plus + Vite 后台管理系统模板
<p align="left">
<b>基于以下技术构建:</b>
</p>
<table align="center" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td align="center" valign="middle" width="250">
<a href="https://element-plus.gitee.io/" title="ELement Plus" target="_blank">
<img height="60px" src="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAxNTMuNzEgMzgiPjxkZWZzPjxzdHlsZT4uY2xzLTEsLmNscy0ye2ZpbGw6IzQwOWVmZjt9LmNscy0xe2ZpbGwtcnVsZTpldmVub2RkO308L3N0eWxlPjwvZGVmcz48dGl0bGU+6LWE5rqQIDE8L3RpdGxlPjxnIGlkPSLlm77lsYJfMiIgZGF0YS1uYW1lPSLlm77lsYIgMiI+PGcgaWQ9IuWbvuWxgl8xLTIiIGRhdGEtbmFtZT0i5Zu+5bGCIDEiPjxwYXRoIGlkPSJTaGFwZS1Db3B5IiBjbGFzcz0iY2xzLTEiIGQ9Ik0xNDIsMjYuMTZzLjI4LDAsLjgyLDBhLjcyLjcyLDAsMCwxLC42OS40MXMxLjA4LDIsMS4zNywyLjQ4LDAsLjQyLS4xMi40MWgwcy0uMzEsMC0zLjQ1LDBhNC45Myw0LjkzLDAsMCwxLTQuNTQtNC41NHYtN0gxMzQuM1YxNS4yOGMwLS4zNi40MS0uNDEuNDEtLjQxaDIuMDdWMTIuMjVhLjYuNiwwLDAsMSwuNDEtLjU1bDIuMy0uNjZjLjM0LS4xLjU5LDAsLjU5LjM1VjE1aDMuNThjLjM0LDAsLjQxLjQxLjQxLjQxVjE4aC00djYuMDZjMCwxLjc2LDEuOTMsMi4wNywxLjkzLDIuMDdabS0xMC42LDNoLTIuMmMtLjQzLDAtLjQxLS41NS0uNDEtLjU1VjE4LjQ1YzAtLjYyLS44My0uODMtLjgzLS44M2gtNC41NGMtLjY4LDAtLjY5LjgzLS42OS44M1YyOC43N2EuNDEuNDEsMCwwLD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MCwxLDAsMFY5LjM2QS40LjQsMCwwLDEsMTQ1LjA5LDlaIi8+PC9nPjwvZz48L3N2Zz4=" title="Element Plus">
<p>Element Plus</pp>
</a>
</td>
<td align="center" valign="middle" width="250">
<a href="https://www.vue3js.cn/" title="Vue3" target="_blank">
<img height="60px" src="https://vue3js.cn/docs/logo.png" title="Vue3">
<p>Vue 3</p>
</a>
</td>
<td align="center" valign="middle" width="250">
<a href="https://github.com/vitejs/vite" title="Vite" target="_blank">
<img height="60px" src="https://camo.githubusercontent.com/61e102d7c605ff91efedb9d7e47c1c4a07cef59d3e1da202fd74f4772122ca4e/68747470733a2f2f766974656a732e6465762f6c6f676f2e737667" title="Vite">
<p>Vite</p>
</a>
</td>
</tr>
</tbody>
</table>
## 介绍
**Vue3 + Element Plus + Vite** 是基于Vue3编写的后台管理系统,UI框架使用了ELement Plus,构建工具使用Vite。
- 项目使用Vue实验性语法 <sctipt setup></script>进行编写,其中用到了Vue3的Composition API、Vue Router4、VueX4等,Element组件也使用了Composition API模式下的写法。
- 项目出发点的让大家可以快速理解Vue3的Composition API的写法,可以快速上手Vue3和Element Plus,仅仅用于学习,大家如果想构建一个适合自己项目的基础脚手架,估计还得增加不少功能。
- Vite的构建工具自然不用多说,用过就回不去Webpack了,启动项目时间不到1S,运行时响应也非常快,希望尤大大可以尽快适配Vite到下一代的Vue-Cli。
- 项目我也会继续更新,后续计划是增加一些二次封装Element表单表格组件,让新手使用起来更加简单!
- 希望大家可以多多支持哈~~~
## 项目准备
你需要先安装 [node](https://nodejs.org/) 和 [Git](https://git-scm.com/) 工具,项目依赖有[axios](http://www.axios-js.com/)、[element-plus](https://element-plus.gitee.io/#/zh-CN)、[vue](https://cn.vuejs.org)、[vue-router](https://router.vuejs.org/zh-cn/)、[vuex](https://vuex.vuejs.org/zh-cn/)、[vite](https://github.com/vitejs/vite)等
## 项目截图
<p align="center">
<img width="900" src="https://img.wenhairu.com/images/2021/05/30/9pxoj.jpg">
</p>
<p align="center">
<img width="900" src="https://img.wenhairu.com/images/2021/05/30/9pvKU.jpg">
</p>
## Script代码示例(Login)
```vue
<template>
...
</template>
<script setup>
import { ref, reactive, onMounted } from 'vue'
import { useStore } from 'vuex'
import { useRouter } from 'vue-router'
import { ElLoading, ElMessage } from 'element-plus'
const router = useRouter()
const login = ref(null)
const store = useStore()
const userInfo = reactive({
username: 'admin',
password: 'admin',
})
const rules = {
username: [{ required: true, message: '请输入用户名', trigger: 'blur' }],
password: [{ required: true, message: '请输入密码', trigger: 'blur' }],
}
onMounted(() => {
store.commit('clearTags')
})
const submitForm = () => {
login.value.validate(valid => {
if (valid) {
const loading = ElLoading.service({
lock: true,
text: '登录中',
spinner: 'el-icon-loading',
background: 'rgba(0, 0, 0, 0.2)',
})
setTimeout(() => {
ElMessage.success('登录成功')
localStorage.setItem('ms_username', userInfo.username)
router.push('/')
loading.close()
}, 1000)
} else {
ElMessage.error('请输入账号和密码')
loading.close()
ret
白话Learning
- 粉丝: 4725
- 资源: 3085
最新资源
- 【中邮证券-2024研报】浙江鼎力(603338):Q3业绩高增,臂式产品有望持续放量.pdf
- 圣诞树html网页代码
- unity Shader转场效果合集
- ApiFox前置登录脚本,解决每次调接口免登录
- Matlab实现BiLSTM-Adaboost-ABKDE的集成双向长短期记忆网络自适应带宽核密度估计多变量回归区间预测(含完整的程序,GUI设计和代码详解)
- 【国盛证券-2024研报】博腾股份(300363):盈利能力实现改善,订单状况延续高增.pdf
- 【国盛证券-2024研报】皓元医药(688131):产能建设持续进行,业绩环比改善显著.pdf
- 【国盛证券-2024研报】一文读懂IEA《2024年东南亚能源展望.pdf
- 【国泰君安期货-2024研报】股票股指期权:下行升波,股指期权临近到期.pdf
- 【国泰君安期货-2024研报】EUDR对国内橡胶轮胎制品影响:欧盟市场不确定性增加,国内市场售价或上涨.pdf
- 【国泰君安期货-2024研报】股指期货将偏弱震荡,黄金、白银、铜、豆粕、豆油、菜籽油期货将偏弱震荡,原油、燃料油期货将偏强震荡.pdf
- 【国泰君安期货-2024研报】国泰君安期货商品期权日报.pdf
- 【国泰君安期货-2024研报】股指期货将偏弱震荡,黄金、白银、铜、原油期货将偏强震荡,碳酸锂期货将偏弱宽幅震荡,豆粕期货将偏弱震荡.pdf
- 【国泰君安期货-2024研报】股指期货将震荡整理,黄金、白银、铜、豆粕期货将偏弱震荡,碳酸锂期货将偏强震荡.pdf
- 【国泰君安期货-2024研报】南美大豆,玉米主产区天气展望.pdf
- 【国泰君安期货-2024研报】国泰君安期货商品研究晨报:黑色系列.pdf
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈