layui 表单提交后弹出两个弹框的解决方法
{ 'title':'layui 表单提交后弹出两个弹框的解决方法', 'description':'本文介绍了在 layui 表单提交后弹出两个弹框的原因以及解决方法。通过将第一个弹框的代码移动到第二个弹框的条件判断语句内部,可以避免出现两个弹框同时出现的情况。', 'keywords':'layui, 表单提交, 弹框, 解决方法, 两个弹框, 条件判断', 'content':''<button type='button' lay-submit='' lay-filter='costButton' id='costButton'\n class='layui-btn calculate-button' style=''>计算\n form.on('submit(costButton)', function (data) {\n if (table.cache.costEstimatesMFNRate.length === 0\n || table.cache.costEstimatesOptimalRate.length === 0) {\n layer.open({\n title: '温馨提示',\n type: 1,\n area: ['35%', '40%'], //宽高\n content: '
再来预估成本哦~