Home > Article > Web Front-end > Redirects for Vue.js routing
This time I will bring you the redirection of Vue.js routing. What are the precautions for using Vue.js routing redirection? The following is a practical case, let’s take a look.
redirect
Set when initializing routing
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', ...... } ] })
I believe you have mastered the method after reading the case in this article. For more exciting information, please pay attention to the php Chinese website Other related articles!
Recommended reading:
The above is the detailed content of Redirects for Vue.js routing. For more information, please follow other related articles on the PHP Chinese website!