Vue.js--axios详解
axios axios是一个基于Promise,同时支持浏览器端和Node.js的HTTP库,常用于Ajax请求。 安装axios npm install axios --save axios的请求方式 axios(config) axios.request(config) axios.get(url [, config]) axios.delete(url [, config]) axios.head(url [, config]) axios.post(url [, data [,config]]) axios.put(url [, data [, config]]) axios.patch(url [, data [, config]]) 直接发起GET请求: import axios from 'axios' //1. 没有请求参数 axios . get ( 'http://123.207.32.32:8000/home/multidata' ) . then ( res => { console . log ( res ) ; } ) . catch ( err => { console . log ( err ) ; } ) //2.有参数 axios . get ( 'http://123.207.32.32:8000/home/data?type=sell