修复 form 在 IE 和 Safari 存在一个正则零宽断言报错的问题

pull/1301/head
贤心 2023-07-03 18:29:19 +08:00
parent e3dcb915a1
commit 0f9ca9c6f5
1 changed files with 2 additions and 1 deletions

View File

@ -296,7 +296,8 @@ layui.define(['lay', 'layer', 'util'], function(exports){
// 小数点后保留位数
var fixed = function(step){
return (step.match(/(?<=\.)[\d]+$/) || [''])[0].length;
var decimals = (step.match(/\.(\d+$)/) || [])[1] || '';
return decimals.length;
}(step.toString());
if(fixed) value = value.toFixed(fixed);