Jun 11, 2022
2
Level 63
How is it possible to use props inside mount() ?
Hello,
I'm trying to use a props inside mount(). The problem is this one :
- before
mount(),studentIdhas no value - while
mount(),studentIdhas no value - after
mount(),studentIdhas a the good value
If you have any idea how to solve that ;), please help me because I have this problem for a while on several components.
The only solution I have found is to set a watcher on the props I need to use in mount() and then I can use the props.
Thanks a lot.
props: {
studentId: {}
},
...
mounted() {
this.loadStats()
},
...
methods: {
loadStats() {
this.$store.dispatch('sessions/getStats', this.studentId)
},
}
Level 51
Please or to participate in this conversation.