标签:ams direct routes vue 分享图片 home world pre ack
1. 我们主要在index.js重新设置路由的重新定向redirect参数
index.js
import Vue from ‘vue‘ import Router from ‘vue-router‘ import HelloWorld from ‘@/components/HelloWorld‘ import Params from ‘@/components/Params‘ Vue.use(Router) export default new Router({ routes: [ { path: ‘/‘, name: ‘HelloWorld‘, component:HelloWorld },{ path:‘/params/:Id/:Title‘, component:Params },{ path:‘/goHome‘, redirect:‘/‘ }, { path:‘/goparams/:Id/:Title‘, redirect:‘/params/:Id/:Title‘ //这里对应的是重定向的path path:‘/params/:Id/:Title‘,
} ] })
2.在App.vue 设置vue-router
效果:
标签:ams direct routes vue 分享图片 home world pre ack
原文地址:https://www.cnblogs.com/guangzhou11/p/9196135.html