wx.showToast问题?

发布于 6 年前作者 guiying704229 次浏览最后编辑 6 年前来自 ask

wx.showToast({

title: '网路异常~ 请重新提交',

icon: 'none'

})

使用wx.showToast组件报错。

常见请求返回404时报错

错误信息:showToast:fail parameter error: parameter.title should be String instead of Undefined;

2 回复
uyan
uyan1 楼5 年前

实际传入的title值是什么?

na17
na172 楼4 年前

你封装时返回的title现在是undefined不是sttring类型。

解决方法:wx.showToast({

title:res.data.msg?:res.data.msg:‘请求失败’

})