想要获取这样的天气和时间信息
代码这样写的
created() {
let obj = {
baseURL: 'http://api.map.baidu.com/telematics/v3/weather',
method: 'post',
data: {
location: "北京市",
output: "json",
ak: "eklfHV01LdEBLSrwUAXZRP6Ctr94f8TO"
}
}
this.axios.post(obj).then( res => {
console.log(res)
})
报错了
TypeError: relativeURL.replace is not a function
axios的用法你没搞清楚,改一下代码应该就好了
官方文档传送门:https://www.kancloud.cn/yunye...