当前位置:网站首页>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.
边栏推荐
猜你喜欢
使用分类权重解决数据不平衡的问题
SOM Network 1: Principles Explained
小程序毕设作品之微信体育馆预约小程序毕业设计成品(4)开题报告
复现gallerycms字符长度限制短域名绕过
Mini Program Graduation Works WeChat Food Recipe Mini Program Graduation Design Finished Product (8) Graduation Design Thesis Template
小程序毕设作品之微信美食菜谱小程序毕业设计成品(8)毕业设计论文模板
数据分析04
小程序毕设作品之微信体育馆预约小程序毕业设计成品(2)小程序功能
Deep Learning Course2 Week 2 Optimization Algorithms Exercises
编曲软件FL studio20.8中文版功能和作用
随机推荐
PAM 回文自动机
小程序中的多表联合查询
论文解读(GSAT)《Interpretable and Generalizable Graph Learning via Stochastic Attention Mechanism》
联邦学习的框架搭建
Postman batch test interface detailed tutorial
13、学习MySQL 分组
如何给 UE4 场景添加游戏角色
Create virtual environments with virtualenv and Virtualenvwrapper virtual environment management tools
解决 win10 下 ISE14.7的 iMPACT 崩溃问题 - FPGA 笔记
NgRx Selector 的 Memoization 特性学习笔记
number of solutions to solve a multivariate multi-degree equation
vscode hide menu bar
excel change cell size
得物客服热线的演进之路
小程序毕设作品之微信美食菜谱小程序毕业设计成品(7)中期检查报告
小程序毕设作品之微信体育馆预约小程序毕业设计成品(4)开题报告
10年稳定性保障经验总结,故障复盘要回答哪三大关键问题?|TakinTalks大咖分享
SOM Network 1: Principles Explained
小程序毕设作品之微信体育馆预约小程序毕业设计成品(1)开发概要
46.全排列