当前位置:网站首页>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.
边栏推荐
- Interpretation of the paper (GSAT) "Interpretable and Generalizable Graph Learning via Stochastic Attention Mechanism"
- 【C补充】链表专题 - 单向链表
- excel change cell size
- Deep Learning Course2 Week 2 Optimization Algorithms Exercises
- [Recommended books] The first self-driving technology book
- xctf attack and defense world web master advanced area webshell
- No more rolls!After joining ByteDance for a week, he ran decisively.
- 从0到1:图文投票小程序设计与研发笔记
- 小程序中的多表联合查询
- 深度学习Course2第一周Practical aspects of Deep Learning习题整理
猜你喜欢

Prufer sequence

xctf attack and defense world web master advanced area webshell

JS prototype hasOwnProperty in Add method Prototype end point Inherit Override parent class method

xctf攻防世界 Web高手进阶区 webshell

小程序毕设作品之微信美食菜谱小程序毕业设计成品(6)开题答辩PPT

System availability: 3 9s, 4 9s in SRE's mouth... What is it?

Wechat Gymnasium Reservation Mini Program Graduation Design Finished Work Mini Program Graduation Design Finished Product (2) Mini Program Function

User Experience | How to Measure User Experience?

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

How to add a game character to a UE4 scene
随机推荐
(Translation) How the contrasting color of the button guides the user's actions
Today's sleep quality record 74 points
Postman 批量测试接口详细教程
联邦学习在金融领域的发展和应用
小程序中的多表联合查询
选择合适的 DevOps 工具,从理解 DevOps 开始
blender3.2.1 unit setting
关于ETL的两种架构(ETL架构和ELT架构)
2022年最新河北建筑八大员(机械员)模拟考试题库及答案
力扣第 304 场周赛复盘
excel edit a cell without double clicking
System availability: 3 9s, 4 9s in SRE's mouth... What is it?
如何给 UE4 场景添加游戏角色
从0到100:招生报名小程序开发笔记
Getting Started Database Days4
复现gallerycms字符长度限制短域名绕过
小程序容器+自定义插件,可实现混合App快速开发
vscode hide menu bar
Codeforces CodeTON Round 2 (Div. 1 + Div. 2, Rated, Prizes!) A-D Solution
JS prototype hasOwnProperty in 加方法 原型终点 继承 重写父类方法