这次给大家带来vue.js路由的重定向,使用vue.js路由重定向的注意事项有哪些,下面就是实战案例,一起来看一下。
let router = new VRouter({ // 如果mode设为history, 那么地址就可以不使用哈希(# 哈希)了,就可以直接访问. http://localhost:8080/#/apple ==>> http://localhost:8080/apple mode: 'history', routes: [ { //当路径为'/'时,重新跳转到apple path: '/', //设置重定向 redirect: '/apple' }, { path: '/apple', ...... }, { path: '/banana', ...... } ] })
相信看了本文案例你已经掌握了方法,更多精彩请关注php中文网其它相关文章!
推荐阅读:
立即学习“前端免费学习笔记(深入)”;
以上就是Vue.js路由的重定向的详细内容,更多请关注php中文网其它相关文章!
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号