我在 main.js 文件中的 Vue-Resource 中指定了根选项,但是当我执行请求时,它不使用根选项。我错过了什么?
这是代码:
主.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-Resource v0.6.1
谢谢您的帮助。