本篇文章给大家带来的内容是关于vue.js路由显示设置的方法介绍,有一定的参考价值,有需要的朋友可以参考一下,希望对你有所帮助。
const router= new VueRouter({
routes:[
{path:'/',name:'home',component:Home}, //页面第一显示的组件
{path:'/menu',name:'menu',component:Menu},
{path:'*',redirect:'/'}
],
mode:"history"
});②设置 redirect 的值(适用于 二级路由)
const router= new VueRouter({
routes:[
{path:'/',name:'home',component:Home},
{path:'/about',name:'about',component:About,redirect:{name:'contactLink'},children:[ //二级路由
{path:'/about/contact',name:'contactLink',component:Contact},
{path:'/history',name:'historyLink',component:History},
]},
{path:'*',redirect:'/'}
],
mode:"history"
});相关推荐:
系统特点: 商品多级分类检索、搜索,支持同一商品多重分类,自由设置显示式样 自由设置会员类型,自由设置权限项目,自由分配每种会员类型和每个会员的权限 灵活的商品定价,最多12级价格自由分配给各种会员类型或会员,也可针对单会员单商品特殊定价 强大的会员管理、帐户管理、订单管理功能和一系列帐务查询统计功能 灵活的会员积分系统,自由设置每个积分事件的积分计算方法 灵活的网站内容发布、管理系统,每个栏目可
2
立即学习“前端免费学习笔记(深入)”;
以上就是vue.js路由显示设置的方法介绍的详细内容,更多请关注php中文网其它相关文章!
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号