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

厦门自助网站建设报价河北网站建设免费推荐

厦门自助网站建设报价,河北网站建设免费推荐,电商小程序名字,如何修改网站底部自己的项目要写一个竖栏菜单#xff0c;所以记录一下思路吧#xff0c;先粗糙的实现一把#xff0c;有机会再把细节修饰一下 功能上就是无论这个菜单有多少层级#xff0c;都能显示出来#xff0c;另外#xff0c;需要带图标#xff0c;基于element-plus写成#xff0…自己的项目要写一个竖栏菜单所以记录一下思路吧先粗糙的实现一把有机会再把细节修饰一下 功能上就是无论这个菜单有多少层级都能显示出来另外需要带图标基于element-plus写成当这个菜单栏点开的时候最好整个页面的高度不要有变化最后整成了个小草稿 MyMenu.vue template!-- 自己写的竖栏菜单组件 --!-- el-menu styleheight: 100%;width:100% --el-scrollbar max-height100%el-menu stylewidth: 100%;border: 0; unique-opened :default-activeprops.defaultIndex active-text-color#ffd04bbackground-color#545c64 text-color#fffMenuTree :menu-dataprops.data/MenuTree/el-menu/el-scrollbar /template script langts setup import MenuTree from ./MenuTree.vue const propsdefineProps{data:Arrayany,defaultIndex:string}() /script 里面有个递归组件 MenuTree.vue template!-- 递归组件 --!-- 为了创建无限菜单而使用 --template v-forvalue in props.menuData!-- 没有children就是一个单标签 --el-menu-item v-if!value.children :indexvalue.indextemplate v-ifvalue.iconcomponent :isvalue.icon stylewidth: 1rem;/component/template{{ value.title }}/el-menu-item!-- 多标签的情况 --el-sub-menu v-else :indexvalue.indextemplate #titletemplate v-ifvalue.iconcomponent :isvalue.icon stylewidth: 1rem;/component/template span{{ value.title }}/span/templateMenuTree :menuDatavalue.children/MenuTree/el-sub-menu/template /template script setup langts import MenuTree from ../Page1/MenuTree.vue const propsdefineProps{menuData:Arrayany}() /script 最后写个参数挂载一下我这边用的icon是element-plus组件自带的 templateel-container styleheight: 100vh;el-header stylepadding: 0;height: 5rem;div styleheight: 100%;background-color:pinkspanwelcome to page1/spanbr /span该页面用来写一个竖版menu/span/div/el-headerel-container styleheight: calc(100vh - 5rem);el-aside width15% stylebackground-color:lightblue;MyMenu :datamenuData :default-indexdefaultIndex//el-asideel-main stylebackground-color:rgb(246, 199, 11);component :isiconStr stylewidth: 1rem;/component/el-main/el-container/el-container /template script setup langts import {ref} from vue import { Search,Select,Close,User } from element-plus/icons-vue; import MyMenu from ./MyMenu.vue; let menuData [{title: 睡觉,index: 0,icon: Select},{title: 游戏,index: 1,icon: Search,children: [{title: 上古卷轴,index: 1-1,children: [{title: 上古卷轴匕首雨,index: 1-1-1,},{title: 上古卷轴天际,index: 1-1-2,icon: Select}]},{title: 辐射,index: 1-2,children: [{title: 龙万德,index: 1-2-1},{title: 辐射新维加斯,index: 1-2-2}]}]},{title: 美食,index: 2,icon: Close,children: [{title: 淮扬菜,index: 2-1,children: [{title: 红烧狮子头,index: 2-1-1},{title: 猪头肉,index: 2-1-2},]},{title: 川菜,index: 2-2,children: [{title: 四川泡菜,index: 2-2-1},{title: 水煮鱼,index: 2-2-2},{title: 开水白菜,index: 2-2-3},]},{title: 粤菜,index: 2-3,children: [{title: 白切鸡,index: 2-3-1},{title: 顺德鱼生,index: 2-3-2},{title: 猪肚鸡,index: 2-3-3},]}]},{title: 编程,index: 3,icon: User,children: [{title: golang,index: 3-1,children: [{title: 云原生,index: 3-1-1},{title: gin,index: 3-1-2}]},{title: js,index: 3-2},{title: python,index: 3-3}]} ] // 默认index值 let defaultIndex ref(0) /script 主要过程就是写了一个递归的菜单栏然后用el-scrollbar包装了一下以免这个菜单展开的时候把盒子高度撑开。 细节上难看了一点此外我觉得整个菜单的高度应该和传入数组的最大深度相关得把这个el-scrollbar组件换掉才行先写着有时间完善。
http://www.huolong8.cn/news/37735/

相关文章:

  • 安阳哪个公司做网站好一个人做网站用什么技术
  • 营销型企业网站的建设步骤51网站空间相册在哪里
  • 宝塔自助建站系统源码创意礼物网站建设与管理
  • 网站打开空白页面上海模板网建站
  • 屯留网站建设3yx这个网站做刷单
  • 招生门户网站建设方案信息化建设 公司网站
  • 做公司网站的目的是什么深圳市建设工程服务交易中心
  • 长沙品牌网站设计可以做空股票的网站
  • 商城网站建设代理商苏州工业园区网站
  • 网页设计做网站网站开发常见问题总结
  • 邹城住房城乡建设部网站百度怎么注册自己的网站
  • 简单的网站建设公司的模板外包公司做网站怎么样
  • 网站mip怎么做外贸公司的网站
  • 装修企业网站源码网站网页设计心得
  • 个人可以做外贸网站吗游戏大厅定制游戏开发
  • 网站轮播广告代码网上做兼职做网站
  • 重庆网站营销网站容易出现的问题吗
  • 南昌城市旅游网站建设公众号运营策划书
  • 网站的类型是什么意思开发过程怎么写
  • 网站编辑框超链接怎么做县网站建设
  • 起公司名称大全免费网站seo站长工具综合查询
  • 学习html5的网站网站建设yankt
  • 商城网站模板 免费金坛建设网站
  • 顺的网站建设多少钱促进房地产市场健康发展
  • wordpress 获取网站地址建筑工地招工
  • 宁德网站建设51yunsou网站如何做百度推广
  • 网站的建设可以起到什么作用是什么原因营销方式方案案例
  • 建设银行纪检监察网站wordpress换主题后打不开
  • 北京海淀网站建设做网站郴州
  • 做网站需要每年都交钱吗产品宣传