foreword
For example, there is a list page. After clicking, you can enter the details page with parameters. When the details page is refreshed, the carried parameters cannot be obtained.
What we want is, no matter how we refresh the target page,
There will be no situation where it cannot be obtained, as shown in the following figure:
solution
If you pass
query
an object or an array by means of , it will be coerced into the address bar[object Object]
, so you can't get it.
But you can convert it by passing the object parameter, through the JSON.stringify()
method ,
Use on the receiving page (target page JSON.parse()
) and go back.
// 列表页
const data = {
type: 'a1', value