Ich spezifiziere eine Wurzeloptionen in meiner Vue-Ressource in meiner main.js Datei, aber wenn ich die Anfrage mache, benutzt sie nicht die root Optionen. Was vermisse ich ?Vue Ressourcenstammoptionen nicht verwendet?
Hier ist der Code:
main.js:
Vue.http.options.root = 'http://api.domain.com/v1/'
In einer Komponente:
ready: function() {
console.log(this.$http.options.root) // Correctly show 'http://api.domain.com/v1/'
this.$http.get('/members/', null, { // FAILS because it tries to load /members/ in the current domain
headers: {'auth-token': 'abcde'}
}).then(function (xhr) {
// process ...
})
}
Was mache ich falsch?
Ich verwende Vue.js v1.0.15 und Vue-Ressource v0.6.1
Vielen Dank für Ihre Hilfe.
LOL, danke. Ich habe auch gekämpft, warum root nicht funktioniert. – GusDeCooL