优化 table 当数据值为 0,undefined,null 且开启列模板,编辑单元格会带入模板字符的问题

解决:[#I8JOSW](https://gitee.com/layui/layui/issues/I8JOSW)
This commit is contained in:
贤心 2023-11-28 10:25:44 +08:00
parent 06514f02c4
commit 1d408f0f4a

View File

@ -2379,8 +2379,9 @@ layui.define(['lay', 'laytpl', 'laypage', 'form', 'util'], function(exports){
}
return inputElem;
}());
input[0].value = othis.data('content') || data[field] || elemCell.text();
input[0].value = function(val) {
return (val === undefined || val === null) ? '' : val;
}(othis.data('content') || data[field]);
othis.find('.'+ELEM_EDIT)[0] || othis.append(input);
input.focus();
e && layui.stope(e);