I am trying to use the $router.push method to pass data from one view to another. Here is some part of the code:
let obj = {
foo: 'f1',
foo2: ['f2'],
foo3: {
foo4: [],
foo5: new Map(),
foo6(){ ... }
}
}
Push request at the router:
this.$router.push({
name: 'foo',
params: { id: this.id, data: this.obj }
})
the first parameter works because it is an integer, but the second returns the string: "[Object Object]"
Does the router support this kind of action? If so, how can I do this?
What would be the best strategy to do this kind of communication?
PS: I am detecting the state change of the router via watch