欢迎来到尧图网

客户服务 关于我们

您的位置:首页 > 财经 > 创投人物 > vue2侧边导航栏路由

vue2侧边导航栏路由

2025/7/6 10:40:56 来源:https://blog.csdn.net/qq_48435896/article/details/143890177  浏览:    关键词:vue2侧边导航栏路由
<template><div><!-- :default-active="$route.path" 和index对应其路径 --><el-menu:default-active="active"class="el-menu-vertical-demo"background-color="#545c64"text-color="#fff"active-text-color="#ffd04b"router:collapse="isCollapse"><el-menu-item><span slot="title">XX后台管理系统</span></el-menu-item><el-menu-item index="/"><i class="el-icon-menu"></i><span slot="title">首页</span></el-menu-item><el-submenu index="/product"><template slot="title"><i class="el-icon-location"></i><span>产品管理</span></template><el-menu-item-group><el-menu-item index="/product/list"><i class="el-icon-location"></i><span> 产品列表</span></el-menu-item><el-menu-item index="/product/category"><i class="el-icon-location"></i><span> 产品分类</span></el-menu-item></el-menu-item-group><el-submenu index="/product/purchase"><template slot="title">产品采购</template><el-menu-item index="/product/purchase/scheme">采购营销</el-menu-item></el-submenu></el-submenu><el-submenu index="/order"><template slot="title"><i class="el-icon-location"></i><span>订单管理</span></template><el-menu-item-group><el-menu-item index="/order/orderlist"><i class="el-icon-location"></i><span>订单列表</span></el-menu-item><el-menu-item index="/order/summary"><i class="el-icon-location"></i><span>汇总清单</span></el-menu-item><el-menu-item index="/order/review"><i class="el-icon-location"></i><span>订单审核</span></el-menu-item></el-menu-item-group></el-submenu><el-menu-item index="3" disabled><i class="el-icon-document"></i><span slot="title">广告分类</span></el-menu-item><el-submenu index="/system"><template slot="title"><i class="el-icon-location"></i><span>系统管理</span></template><el-menu-item-group><el-menu-item index="/system/adminstartion"><i class="el-icon-location"></i><span>系统列表</span></el-menu-item></el-menu-item-group><el-menu-item-group><el-menu-item index="/system/settings"><i class="el-icon-location"></i><span>系统设置</span></el-menu-item></el-menu-item-group></el-submenu></el-menu></div>
</template>
<script>export default {props:['isCollapse'],data(){return{// isCollapse:false}},methods:{handle(){console.log(11111)}},computed:{active(){return this.$route.path}}}
</script><style scoped lang="less">.el-menu-vertical-demo:not(.el-menu--collapse) {width: 200px;min-height: 400px;}/deep/.el-menu-item-group__title{padding: 0;}
</style>

总的vue中引入侧边栏的组件:

在这里插入图片描述

版权声明:

本网仅为发布的内容提供存储空间,不对发表、转载的内容提供任何形式的保证。凡本网注明“来源:XXX网络”的作品,均转载自其它媒体,著作权归作者所有,商业转载请联系作者获得授权,非商业转载请注明出处。

我们尊重并感谢每一位作者,均已注明文章来源和作者。如因作品内容、版权或其它问题,请及时与我们联系,联系邮箱:809451989@qq.com,投稿邮箱:809451989@qq.com

热搜词