当前位置:网站首页>Background project Express-Mysql-Vue3-TS-Pinia page layout-sidebar menu
Background project Express-Mysql-Vue3-TS-Pinia page layout-sidebar menu
2022-08-01 22:43:00 【Mong tsai meters Sue】
携手创作,共同成长!这是我参与「掘金日新计划 · 8 月更文挑战」的第4天,点击查看活动详情
页面布局-侧边栏菜单
引言
通过之前一段时间 Express 和 Mysql 的学习
这里尝试来搭建一个 后台系统 来巩固下学习的技术.
页面布局-侧边栏菜单
侧边栏菜单,Essential for our backend projects.
这里主要是通过 ElementPlus 中的 Three important labels
el-menu、el-sub-menu、el-menu-item
and coordinating routing route 和 router to control the jump.
今天讲解 el-menu 以及 通过 Pinia 来控制 A stretch of the menu
el-menu
目录结构如下:
// layout/aside/index.vue
<template>
<div>
<el-aside id="asideNav">
<div class="logo-name">
<span v-if="logoShow">wzms</span>
<span v-else>旺仔米苏</span>
</div>
<div class="elmenu">
<el-menu class="el-menu-vertical" :default-active="route.path" background-color="#03152A" text-color="rgba(255,255,255,.7)" active-text-color="#ffffff" @select="selectmenu" :router="true" :collapse="isCollapse" :collapse-transition="true" :uniquerouter="uniquerouter" >
</el-menu>
</div>
</el-aside>
</div>
</template>
<script setup lang="ts"> import { storeToRefs } from 'pinia' import { useLayoutStore } from '@/store' import { useRoute, useRouter } from 'vue-router' const layoutStore = useLayoutStore() const { logoShow, isCollapse, uniquerouter } = storeToRefs(layoutStore) const router = useRouter() const route = useRoute() const selectmenu = (key) => { console.log(key, 'key') } </script>
<style lang="scss" scoped> #asideNav { width: auto !important; height: 100%; display: flex; flex-direction: column; overflow: hidden; .logo-name { height: 50px; line-height: 50px; text-align: center; font-size: 16px; background-color: #03152a !important; color: #5e6d82; z-index: 999; font-weight: 300; } .el-menu-vertical:not(.el-menu--collapse) { width: 200px; overflow-y: scroll; overflow-x: hidden; &::-webkit-scrollbar { display: none; } } .elmenu { height: 100%; background-color: #03152a; overflow-y: scroll; overflow-x: hidden; &::-webkit-scrollbar { display: none; } ul { border-right: none; } } } </style>
复制代码You can see that the current menu style has been processed,
At this point the effect of the page has come out,
有 侧边栏、header、面包屑、main、footer
尝试点击 The control menu expands and contracts Change the width of the menu.
Pinia 中的代码如下
After clicking the After button,The menu in the left sidebar is zoomed,效果如下:
再次点击后,will be restored.
总结
通过 Express-Mysql-Vue3-TS-Pinia 做出一个 后台系统 项目
页面布局-侧边栏菜单,The overall layout effect has been preliminarily completed.
边栏推荐
- 自建 Prometheus 采集腾讯云容器服务监控数据最佳实践
- SAP Spartacus Accessibility E2E 端到端测试
- 浅析多服务在分布式系统下多事务通信处理机制方案
- Implementation principle of VGUgarbage collector (garbage collector)
- leetcode刷题
- 46.全排列
- 【SeaTunnel】从一个数据集成组件演化成企业级的服务
- String - Trie
- Deep learning Course2 first week Practical aspects of Deep Learning exercises
- excel change cell size
猜你喜欢

从0到1:图文投票小程序设计与研发笔记

10年稳定性保障经验总结,故障复盘要回答哪三大关键问题?|TakinTalks大咖分享

(Translation) How the contrasting color of the button guides the user's actions

关于ETL的两种架构(ETL架构和ELT架构)

ROS2初级知识(8):Launching启动多节点

小程序毕设作品之微信美食菜谱小程序毕业设计成品(8)毕业设计论文模板

联邦学习在金融领域的发展和应用

How to prevent governance attacks in DAOs?

2022 edition of MySQL tutorial, top collection good, take your time

Advanced Algebra_Proof_The algebraic multiplicity of any eigenvalue of a matrix is greater than or equal to its geometric multiplicity
随机推荐
深度学习Course2第二周Optimization Algorithms习题整理
ROS2初级知识(8):Launching启动多节点
小程序毕设作品之微信体育馆预约小程序毕业设计成品(2)小程序功能
杭电多校3 1012. Two Permutations dp*
JS prototype hasOwnProperty in Add method Prototype end point Inherit Override parent class method
Codeforces CodeTON Round 2 (Div. 1 + Div. 2, Rated, Prizes!) A-D 题解
excel change cell size
SQL Server(设计数据库--存储过程--触发器)
xctf攻防世界 Web高手进阶区 webshell
ping no reply
long investment career
xctf attack and defense world web master advanced area web2
字符串——Trie
Use Jenkins for continuous integration, this knowledge point must be mastered
10年稳定性保障经验总结,故障复盘要回答哪三大关键问题?|TakinTalks大咖分享
小程序毕设作品之微信美食菜谱小程序毕业设计成品(6)开题答辩PPT
excel vertical to horizontal
复现gallerycms字符长度限制短域名绕过
xctf攻防世界 Web高手进阶区 web2
如何理解 new (...args: any[]) => any