摘要: import { useRouter } from 'vue-router' const router = useRouter() router.push({ path: "/about", query: { name: "why", age: 18 } }) 如何得到query呢 ? 模板中 : 阅读全文
posted @ 2022-08-25 15:50 杨建鑫 阅读(19) 评论(0) 推荐(0) 编辑
摘要: 在路由配置里面,路径后面加 /:值 ,那么路径就会有了参数 例子 : { name:'home', path:'/home/:abc', component:Home } <router-link to="/home/875">Home</router-link> <router-link to=" 阅读全文
posted @ 2022-08-25 15:29 杨建鑫 阅读(36) 评论(0) 推荐(0) 编辑
摘要: 1.路由里面的 redirect 重定向 redirect 重定向 : 把 '/' 直接定到 '/home' 去 {path:'/',redirect:'/home'}, // redirect 重定向 : 把 '/' 直接定到 '/home' 去 {path:'/',redirect:'/home 阅读全文
posted @ 2022-08-25 15:28 杨建鑫 阅读(204) 评论(0) 推荐(0) 编辑