Router do not pass id
to props.In your case you can find id
in this.$route.params
Even if you use something like /book/:id
in router itself, that id
param will live in this.$route.params.id
.
So you need something like :
created() {
this.getBook(this.$router.params.id);
},
And btw, in watcher too.