当前位置: 首页 > news >正文

Springboot项目下面使用Vue3 + ElementPlus搭建侧边栏首页

Springboot项目下面、在html 页面 Vue3 + ElementPlus 搭建侧边栏首页

1、效果图

image-20241227164910444

2、static 文件下面的项目结构

在这里插入图片描述

3、代码实现

<!DOCTYPE html>
<html lang="en">
<head><meta charset="UTF-8"><title>首页</title><!-- Import style --><link rel="stylesheet" href="//unpkg.com/element-plus/dist/index.css" /><!-- Import Vue 3 --><script src="//unpkg.com/vue@3"></script><!-- Import component library --><script src="//unpkg.com/element-plus"></script><!-- 图标 --><script src="//unpkg.com/@element-plus/icons-vue"></script><style>* {margin: 0;padding: 0;box-sizing: border-box; /* 增加 box-sizing 来避免 padding 和 border 影响宽高 */}.el-header {background-color: rgb(204, 212, 255);display: flex;justify-content: space-between; /* 内容分布到两侧 */align-items: center; /* 垂直居中 */padding: 10px 20px;}.el-aside {background-color: rgb(217, 236, 255);height: 90vh;}.el-main {background-color: rgb(236, 245, 255);}.header-content {display: flex;align-items: center;}.header-content span {font-size: 16px; /* 增大欢迎文字的字体 */margin-right: 20px; /* 欢迎文字和登出链接之间的间距 */}.header-content el-link {font-size: 16px; /* 增大登出链接的字体 */}</style>
</head>
<body>
<div id="app" class="common-layout"><el-container><el-header><h2 style="text-align: center">未来智慧社区管理系统</h2><div class="header-content"><span>欢迎您,admin </span></div></el-header><el-container><el-aside width="200px"><el-menudefault-active="2"class="el-menu-vertical-demo"><el-sub-menu index="1"><template #title><el-icon><location/></el-icon><span>物业系统</span></template><el-menu-item><el-link index="1-1" href="/pages/house.html" target="mainFrame">房屋管理</el-link></el-menu-item><el-menu-item><el-link href="/pages/owner.html" target="mainFrame">业主管理</el-link></el-menu-item><el-menu-item><el-link  index="1-2" href="/pages/building.html" target="mainFrame">楼栋管理</el-link></el-menu-item><el-menu-item><el-link  index="1-3" href="/pages/parking.html" target="mainFrame">车位管理</el-link></el-menu-item></el-sub-menu><el-sub-menu index="2"><template #title><el-icon><Setting /></el-icon><span>系统管理</span></template><el-menu-item><el-link index="2-1" href="/pages/xxx.html" target="mainFrame">用户管理</el-link></el-menu-item><el-menu-item><el-link index="2-2" href="/pages/xxx.html" target="mainFrame">业主管理</el-link></el-menu-item><el-menu-item><el-link index="2-3" href="/pages/xxx.html" target="mainFrame">用户中心</el-link></el-menu-item></el-sub-menu></el-menu></el-aside><el-main><!-- 默认显示 owner --><iframe id="mainFrame" name="mainFrame" src="/pages/owner.html"style="width:100%; height:100%; border:none"></iframe></el-main></el-container></el-container>
</div>
<script>const { createApp } = Vueconst app = createApp({setup(){return {}}});app.use(ElementPlus)//添加图标for (const [key, component] of Object.entries(ElementPlusIconsVue)) {app.component(key, component)}app.mount('#app')</script></body>
</html>
http://www.lryc.cn/news/510698.html

相关文章:

  • 华为 IPD,究竟有什么特点?(二)
  • 【Laravel】接口的访问频率限制器
  • 【WRF模拟】如何得到更佳的WRF模拟效果?
  • 机械臂的各种标定
  • Android监听拨打电话
  • Framework开发入门(一)之源码下载
  • TCP off-path exploits(又一个弄巧成拙的例子)
  • Ajax总结
  • 修改网络ip地址方法有哪些?常用的有这四种
  • SpringBoot获取bean的几种方式
  • Debian12 安装配置 ODBC for GaussDB
  • 空中绘图板:用 Mediapipe 和 OpenCV 实现的创新手势识别应用
  • 讲一个自己写的 excel 转 html 的 java 工具
  • 前端往后端传递参数的方式有哪些?
  • Vue axios 异步请求,请求响应拦截器
  • yarn install 安装报错:Workspaces can only be enabled in private projects.
  • http 请求总结get
  • TCP 和 UDP 的区别:解析网络传输协议
  • 【已解决】pyinstaller打包ico图片报错:OSError: [WinError 225] 无法成功完成操作,因为文件包含病毒或潜在的垃圾软件。
  • SpringBoot项目配置文件的优先级
  • JS中类型化数组(Typed Arrays)详解和常见应用场景
  • 虚幻引擎是什么?
  • LabVIEW生物医学信号虚拟实验平台
  • 【软件工程】十万字知识点梳理 | 期末复习专用
  • Android --- 在AIDL进程间通信中,为什么使用RemoteCallbackList 代替 ArrayList?
  • ADC(二):外部触发
  • 数仓开发那些事(8)
  • 【CSS in Depth 2 精译_096】16.4:CSS 中的三维变换 + 16.5:本章小结
  • 【连续学习之ResCL算法】2020年AAAI会议论文:Residual continual learning
  • 【zookeeper核心源码解析】第二课:俯瞰QuorumPeer启动核心流程,实现选举关键流程