Pass $ route as parameter to a Vue JS function

2

Is it possible to pass $route as a parameter to a function?

<v-btn color="info" v-on:click="getProximo('this.$route')">
    Próximo
</v-btn>

I need to get a parameter that is in $route , but when I use this.$route.params.NomeParametro inside function getProximo() does not work, would I have to pass as parameter when calling function in click of button?     

asked by anonymous 13.11.2017 / 19:07

1 answer

1

If $store is a property of the component you can use this:

<v-btn color="info" v-on:click="getProximo($route)">
  Próximo
</v-btn>

Or use v-on:click="getProximo" and then within the method:

methods: {
    getProximo(event){
        const route = this.$route;
        // etc...
    }
    
13.11.2017 / 19:37