Showing
1 changed file
with
9 additions
and
2 deletions
@@ -225,7 +225,14 @@ | @@ -225,7 +225,14 @@ | ||
225 | if (o.removeClass(s), layui.each(c, function (t, l) { | 225 | if (o.removeClass(s), layui.each(c, function (t, l) { |
226 | var c, f = "", v = "function" == typeof a[l]; | 226 | var c, f = "", v = "function" == typeof a[l]; |
227 | if (a[l]) { | 227 | if (a[l]) { |
228 | - var c = v ? f = a[l](d, r) : !a[l][0].test(d); | 228 | + // 资源,选择资源协议报错 |
229 | + let regTest = function (itemVal){ | ||
230 | + if(a[l][0] == ''){ | ||
231 | + return false; | ||
232 | + } | ||
233 | + return !a[l][0].test(itemVal); | ||
234 | + } | ||
235 | + var c = v ? f = a[l](d, r) : regTest(d); | ||
229 | if (f = f || a[l][1], "required" === l && (f = o.attr("lay-reqText") || f), c) return "tips" === u ? i.tips(f, function () { | 236 | if (f = f || a[l][1], "required" === l && (f = o.attr("lay-reqText") || f), c) return "tips" === u ? i.tips(f, function () { |
230 | return "string" == typeof o.attr("lay-ignore") || "select" !== r.tagName.toLowerCase() && !/^checkbox|radio$/.test(r.type) ? o : o.next() | 237 | return "string" == typeof o.attr("lay-ignore") || "select" !== r.tagName.toLowerCase() && !/^checkbox|radio$/.test(r.type) ? o : o.next() |
231 | }(), {tips: 1}) : "alert" === u ? i.alert(f, {title: "提示", shadeClose: !0}) : i.msg(f, { | 238 | }(), {tips: 1}) : "alert" === u ? i.alert(f, {title: "提示", shadeClose: !0}) : i.msg(f, { |
@@ -270,4 +277,4 @@ | @@ -270,4 +277,4 @@ | ||
270 | f.render(null, e) | 277 | f.render(null, e) |
271 | }, 50) | 278 | }, 50) |
272 | }), v.on("submit", r, d).on("click", "*[lay-submit]", d), e(l, f) | 279 | }), v.on("submit", r, d).on("click", "*[lay-submit]", d), e(l, f) |
273 | -}); | ||
280 | +}); |
-
Please register or login to post a comment