vue3调用高德天气

1.先在高德开发平台申请key,记得选择web服务

在这里插入图片描述

2.然后直接在代码里面get请求
示例

//请求高德天气
        const gaodeWeather = async () =>{
    
    
           const res = await axios.get('https://restapi.amap.com/v3/weather/weatherInfo?key=234e06465507fad793f681f3d494df70&city=420100&extensions=all')
           console.log(res)
        }

3.返回
在这里插入图片描述

猜你喜欢

转载自blog.csdn.net/weixin_42821697/article/details/124796582