How can i use the options.root
See original GitHub issueHi, I set the global option of root, Vue.http.options.root = 'www.domain.net'
, then i could get the value in the whole project. ok.
While I think that this will help me to add the root to url automatically. Like this code, finally, i could get the url is " http://www.domain.net/differentPartUrl?token=123".
this.$http.get('/differentPartUrl', {token: '123'}).then((response) => {
// success callback
}, (response) => {
// error callback
console.log(response)
})
But I tried several times, all failed. It can’t help me. In the end, the path is like this “/differentPartUrl”.
So I have to set the whole url by myself , like the below:
this.$http.get(this.$http.options.root + '/someUrl?token=123').then((response) => {
// success callback
}, (response) => {
// error callback
console.log(response)
})
Luckily, it could work. But I not feel satisfactory, i want to know more.
Issue Analytics
- State:
- Created 7 years ago
- Comments:6
Top Results From Across the Web
A ROOT Guide For Beginners
ROOT is very flexible and provides both a programming interface to use in own applications and a graphical user interface for interactive data...
Read more >Option Class Reference - ROOT
Returns a pointer to the first element of the linked list. Use this when you want the first occurrence of an option on...
Read more >A ROOT Guide For Beginners “Diving Into ROOT”
ROOT is a software framework for data analysis and I/O: a powerful tool to cope with the demanding tasks, typically state of the...
Read more >CERN ROOT Tutorial 24: Using Input Parameters - YouTube
You can visit the full playlist for watching all videos of this tutorial ...
Read more >CERN ROOT Tutorial 9: Fit Function and Parameters - YouTube
CERN ROOT Tutorial 9: Fit Function and Parameters ... This ROOT tutorial shows, how to fit ROOT built-in functions to data in a...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Not a bug.
When using the
root
option, don’t use a slash at the beginning. Using a slash indicated it should go to<currentdomain>/path
wrong:
right:
There is either a typo or the API changed:
Vue.url.options.root = ...
works.https://jsfiddle.net/Linusborg/nkx2j0jv/
I’ll send in a Pull request later top updater the docs.