微信小程序踩坑集
阿新 • • 發佈:2017-08-07
log icon spa utils for not duration 是我 問題
setData function is not defined 這個問題只會出現在
wx.request(OBJECT)中
具體替代嗎吧!寫日誌真的不是我的強項
//logs.js var util = require(‘../../utils/util.js‘) Page({ data: { logs: [], array: [] }, onLoad: function () { var that = this this.setData({ logs: (wx.getStorageSync(‘logs‘) || []).map(function(log) { return util.formatTime(new Date(log)) }) }), wx.request({ url: ‘http://www.micuer.com/xiaochengxu.php‘, data: { x: ‘1‘, y: ‘1‘ }, header: { ‘content-type‘: ‘application/json‘ }, success: function(res) { that.setData({array : res.data.data }) wx.showToast({ title: ‘成功‘ + res.data.msg, icon: ‘success‘, duration: 2000 }) } }) } })
微信小程序踩坑集