vue跳转页面增加等待_vue跳转页面方法
1.? router-link1. 不帶參數(shù)?? //name,path都行, 建議用name??// 注意:router-link中鏈接如果是'/'開始就是從根路由開始,如果開始不帶'/',則從當前路由開始。???2.帶參數(shù)????// params傳參數(shù) (類似post)// 路由配置 path: "/home/:id" 或者 path: "/home:id"?// 不配置path ,第一次可請求,刷新頁面id會消失// 配置path,刷新頁面id會保留?// html 取參? $route.params.id// script 取參? this.$route.params.id????// query傳參數(shù) (類似get,url后面會顯示參數(shù))// 路由可不配置?// html 取參? $route.query.id// script 取參? this.$route.query.id
2.? this.$router.push() (函數(shù)里面調用)1.? 不帶參數(shù)?this.$router.push('/home')this.$router.push({name:'home'})this.$router.push({path:'/home'})???2. query傳參??this.$router.push({name:'home',query: {id:'1'}})this.$router.push({path:'/home',query: {id:'1'}})?// html 取參? $route.query.id// script 取參? this.$route.query.id
————————————————版權聲明:本文為CSDN博主「懂懂kkw」的原創(chuàng)文章,遵循 CC 4.0 BY-SA 版權協(xié)議,轉載請附上原文出處鏈接及本聲明。原文鏈接:https://blog.csdn.net/jiandan1127/article/details/86170336
總結
以上是生活随笔為你收集整理的vue跳转页面增加等待_vue跳转页面方法的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 《信号与系统》解读 前言:为什么要解读《
- 下一篇: vuex 源码分析_Vuex框架原理与源