stay vue There are two forms of the middle route :1.params;2.query

terms of settlement :sessionStorage perhaps localStorage
The difference between the two :localStorage Is permanent save not clear always exist ,sessionStorage Close the client and clear it

First, there are two pages , Popular point page 1 and page 2 ;
Page one passes routing parameters to page two

<>params parameter
this.id = 666 this.$router.push({ name: ' Page 2 ', params: { id: this.id } })
Get parameters on page 2 id
let id = this.$route.params.id console.log(id) //666
id For us 666;
however ,
If we refresh the page , It will cause the problem of parameter loss ,
console.log(id) //undefined
solve

Page one
this.id = 666 sessionStorage.setItem('id',this.id ) this.$router.push({ name:
' Page 2 ', params: { id: this.id } })
Page 2
let id = this.$route.params.id!=undefined ? this.$route.params.id :
sessionStorage.getItem('id') console.log(id) //666
<>query parameter
let obj={ id:666, Ma:{ name:' pony ' } } this.$router.push({ path:"/Echartss",
query:obj })
On page two
console.log(this.$route.query.id,'this.$route.query.id') //666 console.log(
this.$route.query.Ma,'this.$route.query.Ma') //{name:' pony '}
After refreshing the page
console.log(this.$route.query.id,'this.$route.query.id') //666 console.log(
this.$route.query.Ma,'this.$route.query.Ma')//[object Object]
You can't get it name Value of

solve

Page one
let obj = { id: 666, Ma: { name: " pony " } }; sessionStorage.setItem("obj", JSON.
stringify(obj)); this.$router.push({ path:"/Echartss", query:obj })
Page 2
let id = this.$route.query.id!=undefined ? this.$route.query.id : JSON.parse(
sessionStorage.getItem('obj')).id let Ma = this.$route.query.Ma.name!=undefined
? this.$route.query.Ma : JSON.parse(sessionStorage.getItem('obj')).Ma console.
log(id) //666 console.log(Ma) //{name:" pony "}
adopt JSON Turn object into json The solution of string reformatting

Technology
©2019-2020 Toolsou All rights reserved,
tkinter Implementation of user login interface Vue Invalid render dynamic component in subcomponent ( First invalid , Valid for the second time )9 ride 9 Sudoku C/C++ Memory model TypeScript actual combat -12-TS The mechanism of type checking - Type inference Java Thread safety and insecurity JLink,STLink,DAPLink,CMSIS DAP Differences in use Chapter 10 use SpringMVC Frame transformation of supermarket order management system -1C Language calculation of deposit interest About the Blue Bridge Cup , Things you should know !