[Vuejs]-Handling contextual links from restful api in vuejs

1👍

Add to your link this:

<a v-if="item._links.complete" :href="#" @click.prevent="clickHandler($event, item._links.complete.href)">

Within your vue component methods add new method:

methods:{
    clickHandler(event, yourUrl){
        axios.get(yourUrl)
        .then(function (response){
            //do what you need with this response
        }
    }
}

Leave a comment