文档:360免费天气API接口.note
链接:http://note.youdao.com/noteshare?id=8333c579b80f71e91a4156745fde5b27&sub=2E539D6ADEE047AB8653FB87EAD12E8E
created() {
// 开始设置时间
if (this.timeInterval) {
clearInterval(this.timeInterval);
} else {
this.timeInterval = setInterval(() => {
this.showTime()
}, 1000);
}
},
destroyed() {
clearInterval(this.timeInterval);
},
data() {
return {
timeInterval: null, //时间循环
nowTemp: ‘’, //当前温度
nowWeek: ‘’, //当前日期
nowTime: ‘’, //当前时间
weatherInfo: ‘’, //天气情况
minMaxTemp: ‘’, //最低、最高气温
airQuality: ‘’, //空气质量
humidity: ‘’, //湿度
weatherIcon: ‘’, //天气图标
};
},
getWeather(){
this.$fetchJsonp(
“http://cdn.weather.hao.360.cn/sed_api_weather_info.php?app=360chrome&code=101230101”,
{jsonpCa