Vincent Kituyi
Vincent Kituyi

Reputation: 119

vuejs vue-router Cannot read property 'push' of undefined

Hi guys I am using vuejs and laravel to redirect url, unfortunately I keep on getting the error 'Cannot read property 'push' of undefined'.

Here is the code:

edit(animal){

   this.$route.router.push({path: '/api/animals/' + animal.id + '/edit'})

    },

Upvotes: 0

Views: 2604

Answers (1)

Vincent Kituyi
Vincent Kituyi

Reputation: 119

Thanks guys. This way solved the issue.

 edit(animal){

 this.$router.push({path: '/api/animals/' + animal.id + '/edit'})

},

Upvotes: 1

Related Questions