0

I was wondering if this is possible:

For example i have two Vue.js files, lets call them file A and B. On file there's on click function where the function has router.push to file B. But i need to pass from file A to file B parameter lets say some 'string'.

This is my function on file A:

   goPage(x, y) {
      let vm = this;
      vm.$router.push(`/${x}/${y}`);
    },

And my question is: is this is possible to do and if so, how can i achieve this.

Thanks for any help/articles/clues!

Vortex666
  • 65
  • 8
  • 2
    Is this what are you looking [https://stackoverflow.com/questions/45151810/passing-props-with-programmatic-navigation-vue-js](https://stackoverflow.com/questions/45151810/passing-props-with-programmatic-navigation-vue-js)? – fatm Feb 15 '22 at 11:23
  • What are these files? If they are components then the primary concern is their relationship, think in components and not files. This also depends on what's the context for this function, i.e. `this`. If it's `method`, it's bound. – Estus Flask Feb 15 '22 at 12:11
  • Well fatm mentioned simmilar question, and from there i know that i cant pass parameter in router push while passing path as a string. Ill close this thread about tommorow if ill solve it by my self – Vortex666 Feb 15 '22 at 12:30

0 Answers0