methods:{ goSearch(){ // 1.路由传参字符串形式 // this.$router.push("/Search/"+this.keyword+"?k="+this.keyword.toUpperCase()) // 2 模板字符串 // this.$router.push(`/search/${this.keyword}?k=${this.keyword.toUpperCase()}`) //3.对象传参 this.$router.push({ name:"search", params:{keyword:this.keyword}, query:{k:this.keyword.toUpperCase()} }) } },
标签:传参,vue,keyword,toUpperCase,push,router,路由 From: https://www.cnblogs.com/xiaobaizitaibai/p/16927653.html