I’m using a routable modal . It works well .
Now, i try to pass a parameter and receive it like this:
return {
data: function () {
return {
device: 'empty',
}
},
methods: {
mounted: function () {
this.device = app.views.main.router.currentRoute.params.device;
this.$setState({device: this.device});
},
},
}
The issue is, when the mounted method is called, it seems that currentRoute.params.device is still not available. If i try to access it through the console after opening the popup, it works.
So, this is a hack , that works. But its not very elegant as i need to use setTimeout:
return {
data: function () {
return {
device: 'empty',
}
},
methods: {
updateData: function(params){
this.$setState(params);
},
mounted: function () {
console.log('working');
setTimeout(() => {console.log(app.views.main.router.currentRoute.params.device)}, 100);
},
},
}
Is there another way, using an approach that makes use of something on F7 toolbox, that i’m missing?