You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Dec 1, 2023. It is now read-only.
And I am trying to do something like this on my main component App.vue:
export default {
name: 'app',
watch: {
'$route.params.lang': function(new_val, old_val) { // ex: new_val is now en
this.$http.options.root = 'http://127.0.0.1:8000/api/webapp/' +new_val; <-- trying to change root endpoint
localStorage.setItem('lang', new_val);
console.log(new_val); // en
console.log(localStorage.lang); // en
console.log(this.$http.options.root); // http://127.0.0.1:8000/api/webapp/pt <-- doesn't change
}
}
};
I need to change the root endpoint for the api, or an alternative not far from this simple implementation.
The text was updated successfully, but these errors were encountered:
Miguel-Frazao
changed the title
Setting Vue.http.options.root on a vue instance
Setting Vue.http.options.root on a vue instance, using router params
Jan 26, 2019
Miguel-Frazao
changed the title
Setting Vue.http.options.root on a vue instance, using router params
Setting ...options.root on a vue instance, using router params
Jan 26, 2019
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
I have something like this on my main.js before Vue instatiation:
On my router:
And I am trying to do something like this on my main component App.vue:
I need to change the root endpoint for the api, or an alternative not far from this simple implementation.
The text was updated successfully, but these errors were encountered: