【Vue3 博物馆管理系统】定制上中下(顶部菜单、底部区域、中间主区域显示)三层结构首页

本文主要是介绍【Vue3 博物馆管理系统】定制上中下(顶部菜单、底部区域、中间主区域显示)三层结构首页,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!

系列文章目录

第一章 定制上中下(顶部菜单、底部区域、中间主区域显示)三层结构首页
第二章 使用Vue3、Element-plus菜单组件构建菜单
[第三章 使用Vue3、Element-plus菜单组件构建轮播图]
[第四章 使用Vue3、Element-plus菜单组件构建组图文章]


文章目录

  • 系列文章目录
    • @[TOC](文章目录)
  • 1、系统设计
    • 1.1、前台用户
      • 1.1.1、用户模块
      • 1.1.2、资讯模块
      • 1.1.3、藏品模块
  • 2、本章节效果图
    • 2.1、拆解任务
  • 3、动手开干
    • 3.1、Vue3项目的创建
      • 3.1.1、创建museum空白目录
      • 3.1.2、使用idea打开
      • 3.1.3、创建Vue3项目
        • 3.1.3.1、打开cmd命令,进入到上一步创建的目录;
        • 3.1.3.2、运行命令:vue create front
        • 3.1.3.3、选择 Vue3项目
        • 3.1.3.4、项目构建中
        • 3.1.3.5、构建成功
        • 3.1.3.6、按照提示启动项目
        • 3.1.3.7、在浏览器访问项目
    • 3.2、Vue3 路由应用
      • 3.2.1、在Idea里打开museum项目,展开front工程
      • 3.2.2、为项目安装router
      • 3.2.3、在src下创建view、router目录
        • 3.2.3.1、/view/Home.vue文件
        • 3.2.3.2、/router/index.js文件
        • 3.2.3.3、main.js加载路由
        • 3.2.3.4、App.vue 加载 router-view
        • 3.2.3.5、修改启动端口:80
      • 3.2.4、访问页面
    • 3.3、Element-plus 应用
      • 3.3.1、为项目安装Element-plus
      • 3.3.2、Vue项目加载Element-plus
    • 3.4、Element-plus 的布局、在顶栏区域放置菜单、底栏容器放置站内导航\版权等信息
    • 3.5、执行npm run serve启动项目,可见到第一部分的效果图
  • 总结

在这里插入图片描述

1、系统设计

Vue3 博物馆管理系统,从构建Vue3项目开始,打造一个博物馆系统。
分为2个系统:前台用户、后台管理
在这里插入图片描述

1.1、前台用户

包含模块:用户模块、资讯模块、藏品模块

1.1.1、用户模块

  • 登录
    提供前台用户登录功能
  • 注册
    提供前台用户注册功能
  • 检查登录账号是否唯一
    检索用户库,是否存在相同账号

1.1.2、资讯模块

  • 资讯列表
    咨询列表信息展示
  • 资讯详情
    资讯详情数据展示,展示资讯标题、副标题、发布时间、来源、作者、资讯内容等信息

1.1.3、藏品模块

  • 藏品分类信息查询
    藏品分类信息展示
  • 藏品列表信息查询
    藏品列表信息展示,可根据分类信息过滤查询,可根据藏品标题过滤查询
  • 藏品详情信息查询
    藏品详细信息展示,展示藏品标题、副标题、收藏时间、来源、发现人、收藏价值、年代、藏品内容等信息

2、本章节效果图

在这里插入图片描述

2.1、拆解任务

本章节的任务:
1、Vue3项目的创建;
2、Vue3 路由应用;
3、Element-plus 应用;
4、Element-plus 的布局;
5、在顶栏区域放置菜单;
6、底栏容器放置站内导航、版权等信息

3、动手开干

3.1、Vue3项目的创建

3.1.1、创建museum空白目录

在这里插入图片描述

3.1.2、使用idea打开

在这里插入图片描述

3.1.3、创建Vue3项目

命令格式:vue create 项目名称

由于本章节讲解的是构建前端用户首页,因此我们创建前端项目
vue create front

3.1.3.1、打开cmd命令,进入到上一步创建的目录;
3.1.3.2、运行命令:vue create front
3.1.3.3、选择 Vue3项目

在这里插入图片描述

3.1.3.4、项目构建中

在这里插入图片描述

3.1.3.5、构建成功

在这里插入图片描述

3.1.3.6、按照提示启动项目
cd front
npm run serve

在这里插入图片描述
在这里插入图片描述

3.1.3.7、在浏览器访问项目

访问地址:http://localhost:8080/
在这里插入图片描述

3.2、Vue3 路由应用

3.2.1、在Idea里打开museum项目,展开front工程

在这里插入图片描述

3.2.2、为项目安装router

npm install vue-router@4

安装好之后,打开package.json文件,验证是否有vue-router依赖
在这里插入图片描述

3.2.3、在src下创建view、router目录

在这里插入图片描述

3.2.3.1、/view/Home.vue文件
<template><div><h1>{{msg}}</h1></div>
</template><script>
export default {name: 'Home',data() {return {msg: "首页"}}
}
</script><style scoped></style>
3.2.3.2、/router/index.js文件
import { createRouter, createWebHashHistory } from 'vue-router'const routes = [{path: "/",name: 'home',component: ()=>import("@/view/Home.vue")}
]const router = createRouter({history:createWebHashHistory(),routes
})export default router;
3.2.3.3、main.js加载路由
import { createApp } from 'vue'
import App from './App.vue'
import router from "./router/index"const app = createApp(App);
app.use(router);app.mount('#app');
3.2.3.4、App.vue 加载 router-view
<template><p><router-view/></p>
</template>
3.2.3.5、修改启动端口:80

npm run serve – --port 80
在这里插入图片描述
在这里插入图片描述

3.2.4、访问页面

可以看到这里显示了路由"/"(/view/VueHome.vue)页面的数据
在这里插入图片描述

3.3、Element-plus 应用

3.3.1、为项目安装Element-plus

npm install element-plus --save

检查package.json文件里的element-plus已经加上了
在这里插入图片描述

3.3.2、Vue项目加载Element-plus

在上一步router 的基础上,进一步引入了element-plus

import { createApp } from 'vue'
import App from './App.vue'
import router from "./router/index"
import ElementPlus from 'element-plus';
import 'element-plus/theme-chalk/index.css';const app = createApp(App);
app.use(router);
app.use(ElementPlus)app.mount('#app');

3.4、Element-plus 的布局、在顶栏区域放置菜单、底栏容器放置站内导航\版权等信息

修改App.Vue文件

<template><div id="app" name="app"><el-container><!-- 顶栏容器 --><el-header style="margin-top: 10px;"><el-menu:default-active="1"class="el-menu-demo"mode="horizontal"active-text-color="#409eff"router><div class="logo" style="width: 10%;" ><router-link to="/"><span style="width: 240px; position: absolute; top: 20px; left: 60px; ">xx科技</span><img  src="./assets/logo.png" style="height: 50px;" alt /></router-link></div><el-menu-item index="/" >首页</el-menu-item><el-menu-item index="/history">历史博物馆</el-menu-item><el-menu-item index="/news" >资讯</el-menu-item><el-menu-item index="/about" >关于我们</el-menu-item></el-menu></el-header><!-- 主要区域容器 --><el-main><keep-alive><router-view :key="$route.path+$route.query"></router-view></keep-alive></el-main><!-- 底栏容器 --><el-footer><div class="footer"><el-row :gutter="25"><el-col :span="6" ><div style="width: 100%; color: #c6cbd1; margin: 25px 10px; font-size: 20px"> 服务热线 </div><div style="color: #14cb85; font-size: 18px"><span> <el-icon color="#14cb85"> <phone /> </el-icon>  13999999999</span></div><div style="width: 100%; color: #b0b0b0; margin: 25px 10px"> 深圳市XXXX </div><div style="width: 100%; color: #b0b0b0; margin: 25px 10px"> 邮编:XXXXX</div></el-col><el-col :span="6" ><div style="width: 100%; color: #c6cbd1; margin: 25px 10px; font-size: 20px"> 新闻资讯 </div><div style="width: 100%; color: #b0b0b0; margin: 25px 10px"> <router-link to="/news" style="color: #6a737d;font-size: 17px ">博物馆新闻</router-link>  </div><div style="width: 100%; color: #b0b0b0; margin: 25px 10px"> <router-link to="/news" style="color: #6a737d;font-size: 17px ">行业动态</router-link>  </div></el-col><el-col :span="6" ><div style="width: 100%; color: #c6cbd1; margin: 25px 10px; font-size: 20px"> 关于 </div><div style="width: 100%; margin: 25px 10px">  <router-link to="/about" style="color: #6a737d;font-size: 17px ">关于我们</router-link> </div></el-col></el-row><div class="mod_help"><p class="coty">商城版权所有 &copy; 2012-2021 XXXX</p></div></div></el-footer><!-- 底栏容器END --></el-container></div>
</template><script>export default {name: 'App',components: {}
}
</script><style>
/* 全局CSS */
* {padding: 0;margin: 0;border: 0;list-style: none;
}
#app .el-header {padding: 0;
}
#app .el-main {min-height: 300px;padding: 20px 0;
}
#app .el-footer {padding: 0;
}
a,
a:hover {text-decoration: none;
}
/* 全局CSS END *//* 顶部导航栏CSS */
.topbar {height: 40px;background-color: #3d3d3d;margin-bottom: 20px;
}
.topbar .nav {width: 1225px;margin: 0 auto;
}
.topbar .nav ul {float: right;
}
.topbar .nav li {float: left;height: 40px;color: #b0b0b0;font-size: 14px;text-align: center;line-height: 40px;margin-left: 20px;
}
.topbar .nav .sep {color: #b0b0b0;font-size: 12px;margin: 0 5px;
}
.topbar .nav li .el-button {color: #b0b0b0;
}
.topbar .nav .el-button:hover {color: #fff;
}
.topbar .nav li a {color: #b0b0b0;
}
.topbar .nav a:hover {color: #fff;
}
.topbar .nav .shopCart {width: 120px;background: #424242;
}
.topbar .nav .shopCart:hover {background: #fff;
}
.topbar .nav .shopCart:hover a {color: #ff6700;
}
.topbar .nav .shopCart-full {width: 120px;background: #ff6700;
}
.topbar .nav .shopCart-full a {color: white;
}
/* 顶部导航栏CSS END *//* 顶栏容器CSS */
.el-header .el-menu {max-width: 1225px;margin: 0 auto;
}
.el-header .logo {height: 60px;width: 339px;float: left;margin-right: 100px;position: relative;
}
.el-header .so {margin-top: 10px;width: 300px;position: absolute;right: 1%;}
/* 顶栏容器CSS END *//* 底栏容器CSS */
.footer {width: 100%;text-align: center;background: #2f2f2f;padding-bottom: 20px;
}
.footer .ng-promise-box {border-bottom: 1px solid #3d3d3d;line-height: 145px;
}
.footer .ng-promise-box {margin: 0 auto;border-bottom: 1px solid #3d3d3d;line-height: 145px;
}
.footer .ng-promise-box .ng-promise p a {color: #fff;font-size: 20px;margin-right: 210px;padding-left: 44px;height: 40px;display: inline-block;line-height: 40px;text-decoration: none;background: url("assets/imgs/us-icon.png") no-repeat left 0;
}
.footer .github {height: 50px;line-height: 50px;margin-top: 20px;
}
.footer .github .github-but {width: 50px;height: 50px;margin: 0 auto;background: url("assets/imgs/github.png") no-repeat;
}
.footer .mod_help {text-align: center;color: #888888;
}
.footer .mod_help p {margin: 20px 0 16px 0;
}.footer .mod_help p a {color: #888888;text-decoration: none;
}
.footer .mod_help p a:hover {color: #fff;
}
.footer .mod_help p span {padding: 0 22px;
}
/* 底栏容器CSS END */.flex-grow {flex-grow: 1;
}li.el-menu-item{font-size: 18px;
}</style>

3.5、执行npm run serve启动项目,可见到第一部分的效果图

本章节内容完毕,后续在讲解路由变更、监控路由变化、主要区域容器布局、轮播图、e-tab组件、e-row、e-col组件如何使用。


总结

以上就是今天要讲的内容,本文仅仅简单介绍了博物馆管理系统首页布局,涉及Vue3项目的创建,Vue3 路由,Element-plus 的菜单,Element-plus 的布局等。

这篇关于【Vue3 博物馆管理系统】定制上中下(顶部菜单、底部区域、中间主区域显示)三层结构首页的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!



http://www.chinasem.cn/article/188334

相关文章

Vue3 的 shallowRef 和 shallowReactive:优化性能

大家对 Vue3 的 ref 和 reactive 都很熟悉,那么对 shallowRef 和 shallowReactive 是否了解呢? 在编程和数据结构中,“shallow”(浅层)通常指对数据结构的最外层进行操作,而不递归地处理其内部或嵌套的数据。这种处理方式关注的是数据结构的第一层属性或元素,而忽略更深层次的嵌套内容。 1. 浅层与深层的对比 1.1 浅层(Shallow) 定义

第10章 中断和动态时钟显示

第10章 中断和动态时钟显示 从本章开始,按照书籍的划分,第10章开始就进入保护模式(Protected Mode)部分了,感觉从这里开始难度突然就增加了。 书中介绍了为什么有中断(Interrupt)的设计,中断的几种方式:外部硬件中断、内部中断和软中断。通过中断做了一个会走的时钟和屏幕上输入字符的程序。 我自己理解中断的一些作用: 为了更好的利用处理器的性能。协同快速和慢速设备一起工作

禁止平板,iPad长按弹出默认菜单事件

通过监控按下抬起时间差来禁止弹出事件,把以下代码写在要禁止的页面的页面加载事件里面即可     var date;document.addEventListener('touchstart', event => {date = new Date().getTime();});document.addEventListener('touchend', event => {if (new

安卓链接正常显示,ios#符被转义%23导致链接访问404

原因分析: url中含有特殊字符 中文未编码 都有可能导致URL转换失败,所以需要对url编码处理  如下: guard let allowUrl = webUrl.addingPercentEncoding(withAllowedCharacters: .urlQueryAllowed) else {return} 后面发现当url中有#号时,会被误伤转义为%23,导致链接无法访问

usaco 1.3 Mixing Milk (结构体排序 qsort) and hdu 2020(sort)

到了这题学会了结构体排序 于是回去修改了 1.2 milking cows 的算法~ 结构体排序核心: 1.结构体定义 struct Milk{int price;int milks;}milk[5000]; 2.自定义的比较函数,若返回值为正,qsort 函数判定a>b ;为负,a<b;为0,a==b; int milkcmp(const void *va,c

C#实战|大乐透选号器[6]:实现实时显示已选择的红蓝球数量

哈喽,你好啊,我是雷工。 关于大乐透选号器在前面已经记录了5篇笔记,这是第6篇; 接下来实现实时显示当前选中红球数量,蓝球数量; 以下为练习笔记。 01 效果演示 当选择和取消选择红球或蓝球时,在对应的位置显示实时已选择的红球、蓝球的数量; 02 标签名称 分别设置Label标签名称为:lblRedCount、lblBlueCount

Vue3项目开发——新闻发布管理系统(六)

文章目录 八、首页设计开发1、页面设计2、登录访问拦截实现3、用户基本信息显示①封装用户基本信息获取接口②用户基本信息存储③用户基本信息调用④用户基本信息动态渲染 4、退出功能实现①注册点击事件②添加退出功能③数据清理 5、代码下载 八、首页设计开发 登录成功后,系统就进入了首页。接下来,也就进行首页的开发了。 1、页面设计 系统页面主要分为三部分,左侧为系统的菜单栏,右侧

工厂ERP管理系统实现源码(JAVA)

工厂进销存管理系统是一个集采购管理、仓库管理、生产管理和销售管理于一体的综合解决方案。该系统旨在帮助企业优化流程、提高效率、降低成本,并实时掌握各环节的运营状况。 在采购管理方面,系统能够处理采购订单、供应商管理和采购入库等流程,确保采购过程的透明和高效。仓库管理方面,实现库存的精准管理,包括入库、出库、盘点等操作,确保库存数据的准确性和实时性。 生产管理模块则涵盖了生产计划制定、物料需求计划、

自定义类型:结构体(续)

目录 一. 结构体的内存对齐 1.1 为什么存在内存对齐? 1.2 修改默认对齐数 二. 结构体传参 三. 结构体实现位段 一. 结构体的内存对齐 在前面的文章里我们已经讲过一部分的内存对齐的知识,并举出了两个例子,我们再举出两个例子继续说明: struct S3{double a;int b;char c;};int mian(){printf("%zd\n",s

Windows如何添加右键新建菜单

Windows如何添加右键新建菜单 文章目录 Windows如何添加右键新建菜单实验环境缘起以新建`.md`文件为例第一步第二步第三步 总结 实验环境 Windows7 缘起 因为我习惯用 Markdown 格式写文本,每次新建一个.txt后都要手动修改为.md,真的麻烦。如何在右键新建菜单中添加.md选项呢? 网上有很多方法,这些方法我都尝试了,要么太麻烦,要么不凑效