- 安装包:yarn add axios
- 导入axios:
import axios from 'axios'
- 编写代码请求
var a = axios.create({
baseURL: 'http://localhost:8080',
timeout: 1000,
headers: {
'X-Custom-Header': 'foobar'
}
})
标签:axios,foobar,create,Custom,headers,Vue,使用,安装包
来源: https://www.cnblogs.com/hamusuta/p/16435755.html