- 当前 Bug 的表现(可附上截图)
- 预期表现
跳页,但是报错中断了
- 提供一个最简复现 Demo
制作一个微信小程序搜索记录,但是工具能用,手机报错
formSubmit(e) {
// e.detail = { value: { ‘key’: ‘content’ }, formId: ‘’ }
console.log(e.detail.value.key)
var ggg = e.detail.value.key
if (ggg != ‘’ && ggg != undefined) {
var that = this;
var array = wx.getStorageSync(‘point’);
if (array.length >= 8) { array.pop() };
console.log(array);
array.unshift(ggg)
console.log(array);
wx.setStorage({ key: ‘point’, data: array });
setTimeout(function(){
wx.navigateTo({
url: ‘/pages/seach_list/seach_list?key=’ + ggg,
},500)
})
} else {
wx.showToast({ title: ‘请输入搜索内容’, icon: ‘loading’, duration: 2000 })
}
},