18
我在我的main.js文件中的Vue-Resource中指定了一个根选项,但是当我执行请求时,它不使用根选项。我错过了什么?Vue资源根选项未使用?
下面的代码:
main.js:
Vue.http.options.root = 'http://api.domain.com/v1/'
在一个部件:
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 ...
})
}
我在做什么错?
我使用Vue.js v1.0.15和Vue公司,资源V0.6.1
谢谢您的帮助。
哈哈,谢谢。我也在努力为什么根不工作。 – GusDeCooL