this.$router.push({
    name:'/detail',
    query:{
    	id:123
    }
})
import merge from 'webpack-merge';
 
//修改原有参数        
this.$router.push({
    query:merge(this.$route.query,{'id':1})
})
 
//新增一个参数:
this.$router.push({
    query:merge(this.$route.query,{'addtype':'add'})
})
 
//替换所有参数:
 this.$router.push({
    query:merge({},{'type':'all'})
})

会导致

this.$router.back()   //失效

通过这样跳转

this.$router.push({
    name:'/page',
})
GitHub 加速计划 / vu / vue
207.52 K
33.66 K
下载
vuejs/vue: 是一个用于构建用户界面的 JavaScript 框架,具有简洁的语法和丰富的组件库,可以用于开发单页面应用程序和多页面应用程序。
最近提交(Master分支:1 个月前 )
73486cb5 * chore: fix link broken Signed-off-by: snoppy <michaleli@foxmail.com> * Update packages/template-compiler/README.md [skip ci] --------- Signed-off-by: snoppy <michaleli@foxmail.com> Co-authored-by: Eduardo San Martin Morote <posva@users.noreply.github.com> 3 个月前
e428d891 Updated Browser Compatibility reference. The previous currently returns HTTP 404. 3 个月前
Logo

旨在为数千万中国开发者提供一个无缝且高效的云端环境,以支持学习、使用和贡献开源项目。

更多推荐