Version
4.0.0-beta.12
Reproduction link
https://codesandbox.io/s/affectionate-sunset-dng3r?fontsize=14&hidenavigation=1&theme=dark
Steps to reproduce
this.$router.push({
name: `Target-Page`,
params: {
data: {
fieldA: 'a',
...
filedZ: false,
}
})
What is expected?
this.$route.params?.data is supposed to be an Object data
What is actually happening?
this.$route.params?.data becomes a String data
data: "[object Object]"
Our projects are heavily using route.params to pass dynamic data from page to page.
We also tried "Passing Props to Route Components", which still cannot meet our demand.
We have to use JSON.stringify/JSON.parse/Number()/Boolean() everywhere to pass or retrieve dynamic data if this behaviour is correct for vue-router 4.x.
Looking forward to see a proper explanation.
Thanks!