提交数据时如果哪个为空就弹出相应的提示 只想让它弹一个 如果有多个字段为空就只弹最上面那个 这个应该怎么办呢?
this.data.list.forEach((res) => {
if(res.content==''){
wx.showToast({
title: res.info,
icon: 'none',
duration: 2000
})
}
})
list:[
{
item: '姓名',
content: '',
info: '姓名不能为空,长度不超过10个字'
},
{
item: '身份证',
content: '',
info: '身份证不能为空'
},
{
item: '联系方式',
content: '',
info: '联系方式不能为空'
},
{
item: '原账号',
content: '',
info: '原账号不能为空'
},
{
item: '新账号',
content: '',
info: '新账号不能为空'
}
]