"current": {
"observation_time": "03:38 PM",
"temperature": 18,
"weather_code": 113,
"weather_icons": [
"https://assets.weatherstack.com/images/wsymbols01_png_64/wsymbol_0001_sunny.png"
],
"weather_descriptions": [
"Sunny"
],
"wind_speed": 0,
"wind_degree": 345,
"wind_dir": "NNW",
"pressure": 1011,
"precip": 0,
"humidity": 58,
"cloudcover": 0,
"feelslike": 18,
"uv_index": 5,
"visibility": 16
},
"forecast": {
"2019-09-07": {
"date": "2019-09-07",
"date_epoch": 1567814400,
"astro": {
"sunrise": "06:28 AM",
"sunset": "07:19 PM",
"moonrise": "03:33 PM",
"moonset": "12:17 AM",
"moon_phase": "First Quarter",
"moon_illumination": 54
},
"mintemp": 17,
"maxtemp": 25,
"avgtemp": 21,
"totalsnow": 0,
"sunhour": 10.3,
"uv_index": 5,
<!-- end snippet -->
我想在预报对象下显示日出和日落以及太阳时,到目前为止我已经尝试了{forecast[“2019-09-07”].astro.sunrise},但它仍然不起作用,请告诉我还有什么可以从api中调用它??提前感谢。
3条答案
按热度按时间olhwl3o21#
使用randa路径https://ramdajs.com/docs/#path
mepcadol2#
所以我做了
而且它起作用了,还是谢谢你
idfiyjo83#
请尝试以下内容
谢谢