2020
09-24
09-24
vue.js this.$router.push获取不到params参数问题
主要通过两种方式传参1.query方式传参和接受参数this.$router.push({path:'/xxx'query:{idname:id}})接收的方式:this.$route.query.id2.params方式传递参数this.$router.push({name:'路径名称'query:{idname:id}})接收的方式:this.$route.params.id代码this.$router.push({path:'/container',params:{url:this.func.url,},});在跳转后的页面中console.log(this.route)发现params是空的问题原因:用法错误,以...
继续阅读 >