微信小程序怎么将一个界面的data数据data test reason查询成功! result city成都 realtime temperature29 humidity56 info阴 wid02 direct北风
可以使用wx.setStorageSync()方法将data数据存储在本地缓存中,例如:
wx.setStorageSync('cityWeather', data.test[0].result);
其中'cityWeather'为缓存的键名,data.test[0].result为需要存储的数据。可以在需要使用该数据的地方使用wx.getStorageSync()方法获取数据,例如:
var cityWeather = wx.getStorageSync('cityWeather');
原文地址: http://www.cveoy.top/t/topic/hjuh 著作权归作者所有。请勿转载和采集!