数据请求:vue-resource
参考
支持的HTTP方法
- get(url, [options])
- head(url, [options])
- delete(url, [options])
- jsonp(url, [options])
- post(url, [body], [options])
- put(url, [body], [options])
- patch(url, [body], [options])
示例
import VueResource from 'vue-resource'
Vue.use(VueResource)
Vue.http.get('//webapi.busi.inke.com/web/live_hotlist_pc', {}).then((response) => {
console.log('[Leo]Vue-resource:success=>', response);
}, (response) => {
console.log('[Leo]Vue-resource:error=>', response);
});
this.$http.get('//webapi.busi.inke.com/web/live_hotlist_pc', {}).then((response) => {
console.log('[Leo]Vue-resource:success=>', response);
}, (response) => {
console.log('[Leo]Vue-resource:error=>', response);
});